l-ai-chat
Version:
AI CHAT
45,861 lines • 1.62 MB
JavaScript
var dL = Object.defineProperty;
var gL = (r, e, t) => e in r ? dL(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
var Wt = (r, e, t) => gL(r, typeof e != "symbol" ? e + "" : e, t);
import { createElementBlock as Ye, openBlock as Ie, renderSlot as n0, createElementVNode as Kt, normalizeStyle as lo, toDisplayString as yL, resolveComponent as a0, Fragment as mL, renderList as _L, normalizeClass as i0, createCommentVNode as Qo, createVNode as o0, createBlock as SL, withDirectives as s0, createTextVNode as xL, vShow as bL, vModelText as wL } from "vue";
const Pl = (r, e) => {
const t = r.__vccOpts || r;
for (const [n, a] of e)
t[n] = a;
return t;
}, TL = {
name: "LAIChatComponent"
}, CL = { class: "chat-box" };
function DL(r, e, t, n, a, i) {
return Ie(), Ye("div", CL, [
n0(r.$slots, "content"),
n0(r.$slots, "input")
]);
}
const ST = /* @__PURE__ */ Pl(TL, [["render", DL]]);
function Gg() {
return {
async: !1,
breaks: !1,
extensions: null,
gfm: !0,
hooks: null,
pedantic: !1,
renderer: null,
silent: !1,
tokenizer: null,
walkTokens: null
};
}
var Mi = Gg();
function xT(r) {
Mi = r;
}
var Ws = { exec: () => null };
function Ot(r, e = "") {
let t = typeof r == "string" ? r : r.source;
const n = {
replace: (a, i) => {
let o = typeof i == "string" ? i : i.source;
return o = o.replace(Re.caret, "$1"), t = t.replace(a, o), n;
},
getRegex: () => new RegExp(t, e)
};
return n;
}
var Re = {
codeRemoveIndent: /^(?: {1,4}| {0,3}\t)/gm,
outputLinkReplace: /\\([\[\]])/g,
indentCodeCompensation: /^(\s+)(?:```)/,
beginningSpace: /^\s+/,
endingHash: /#$/,
startingSpaceChar: /^ /,
endingSpaceChar: / $/,
nonSpaceChar: /[^ ]/,
newLineCharGlobal: /\n/g,
tabCharGlobal: /\t/g,
multipleSpaceGlobal: /\s+/g,
blankLine: /^[ \t]*$/,
doubleBlankLine: /\n[ \t]*\n[ \t]*$/,
blockquoteStart: /^ {0,3}>/,
blockquoteSetextReplace: /\n {0,3}((?:=+|-+) *)(?=\n|$)/g,
blockquoteSetextReplace2: /^ {0,3}>[ \t]?/gm,
listReplaceTabs: /^\t+/,
listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g,
listIsTask: /^\[[ xX]\] /,
listReplaceTask: /^\[[ xX]\] +/,
anyLine: /\n.*\n/,
hrefBrackets: /^<(.*)>$/,
tableDelimiter: /[:|]/,
tableAlignChars: /^\||\| *$/g,
tableRowBlankLine: /\n[ \t]*$/,
tableAlignRight: /^ *-+: *$/,
tableAlignCenter: /^ *:-+: *$/,
tableAlignLeft: /^ *:-+ *$/,
startATag: /^<a /i,
endATag: /^<\/a>/i,
startPreScriptTag: /^<(pre|code|kbd|script)(\s|>)/i,
endPreScriptTag: /^<\/(pre|code|kbd|script)(\s|>)/i,
startAngleBracket: /^</,
endAngleBracket: />$/,
pedanticHrefTitle: /^([^'"]*[^\s])\s+(['"])(.*)\2/,
unicodeAlphaNumeric: /[\p{L}\p{N}]/u,
escapeTest: /[&<>"']/,
escapeReplace: /[&<>"']/g,
escapeTestNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,
escapeReplaceNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,
unescapeTest: /&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,
caret: /(^|[^\[])\^/g,
percentDecode: /%25/g,
findPipe: /\|/g,
splitPipe: / \|/,
slashPipe: /\\\|/g,
carriageReturn: /\r\n|\r/g,
spaceLine: /^ +$/gm,
notSpaceStart: /^\S*/,
endingNewline: /\n$/,
listItemRegex: (r) => new RegExp(`^( {0,3}${r})((?:[ ][^\\n]*)?(?:\\n|$))`),
nextBulletRegex: (r) => new RegExp(`^ {0,${Math.min(3, r - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),
hrRegex: (r) => new RegExp(`^ {0,${Math.min(3, r - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),
fencesBeginRegex: (r) => new RegExp(`^ {0,${Math.min(3, r - 1)}}(?:\`\`\`|~~~)`),
headingBeginRegex: (r) => new RegExp(`^ {0,${Math.min(3, r - 1)}}#`),
htmlBeginRegex: (r) => new RegExp(`^ {0,${Math.min(3, r - 1)}}<(?:[a-z].*>|!--)`, "i")
}, AL = /^(?:[ \t]*(?:\n|$))+/, ML = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, IL = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, kl = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, LL = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, Fg = /(?:[*+-]|\d{1,9}[.)])/, bT = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, wT = Ot(bT).replace(/bull/g, Fg).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex(), EL = Ot(bT).replace(/bull/g, Fg).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(), Hg = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, PL = /^[^\n]+/, Wg = /(?!\s*\])(?:\\.|[^\[\]\\])+/, kL = Ot(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", Wg).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), RL = Ot(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, Fg).getRegex(), Mf = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul", $g = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, NL = Ot(
"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))",
"i"
).replace("comment", $g).replace("tag", Mf).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), TT = Ot(Hg).replace("hr", kl).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", Mf).getRegex(), OL = Ot(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", TT).getRegex(), Ug = {
blockquote: OL,
code: ML,
def: kL,
fences: IL,
heading: LL,
hr: kl,
html: NL,
lheading: wT,
list: RL,
newline: AL,
paragraph: TT,
table: Ws,
text: PL
}, l0 = Ot(
"^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"
).replace("hr", kl).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", Mf).getRegex(), VL = {
...Ug,
lheading: EL,
table: l0,
paragraph: Ot(Hg).replace("hr", kl).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", l0).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", Mf).getRegex()
}, BL = {
...Ug,
html: Ot(
`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`
).replace("comment", $g).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),
def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,
heading: /^(#{1,6})(.*)(?:\n+|$)/,
fences: Ws,
// fences not supported
lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
paragraph: Ot(Hg).replace("hr", kl).replace("heading", ` *#{1,6} *[^
]`).replace("lheading", wT).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex()
}, zL = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, GL = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, CT = /^( {2,}|\\)\n(?!\s*$)/, FL = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, If = /[\p{P}\p{S}]/u, Yg = /[\s\p{P}\p{S}]/u, DT = /[^\s\p{P}\p{S}]/u, HL = Ot(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, Yg).getRegex(), AT = /(?!~)[\p{P}\p{S}]/u, WL = /(?!~)[\s\p{P}\p{S}]/u, $L = /(?:[^\s\p{P}\p{S}]|~)/u, UL = /\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g, MT = /^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/, YL = Ot(MT, "u").replace(/punct/g, If).getRegex(), ZL = Ot(MT, "u").replace(/punct/g, AT).getRegex(), IT = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", XL = Ot(IT, "gu").replace(/notPunctSpace/g, DT).replace(/punctSpace/g, Yg).replace(/punct/g, If).getRegex(), qL = Ot(IT, "gu").replace(/notPunctSpace/g, $L).replace(/punctSpace/g, WL).replace(/punct/g, AT).getRegex(), KL = Ot(
"^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)",
"gu"
).replace(/notPunctSpace/g, DT).replace(/punctSpace/g, Yg).replace(/punct/g, If).getRegex(), jL = Ot(/\\(punct)/, "gu").replace(/punct/g, If).getRegex(), QL = Ot(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(), JL = Ot($g).replace("(?:-->|$)", "-->").getRegex(), tE = Ot(
"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>"
).replace("comment", JL).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), Ch = /(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/, eE = Ot(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label", Ch).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), LT = Ot(/^!?\[(label)\]\[(ref)\]/).replace("label", Ch).replace("ref", Wg).getRegex(), ET = Ot(/^!?\[(ref)\](?:\[\])?/).replace("ref", Wg).getRegex(), rE = Ot("reflink|nolink(?!\\()", "g").replace("reflink", LT).replace("nolink", ET).getRegex(), Zg = {
_backpedal: Ws,
// only used for GFM url
anyPunctuation: jL,
autolink: QL,
blockSkip: UL,
br: CT,
code: GL,
del: Ws,
emStrongLDelim: YL,
emStrongRDelimAst: XL,
emStrongRDelimUnd: KL,
escape: zL,
link: eE,
nolink: ET,
punctuation: HL,
reflink: LT,
reflinkSearch: rE,
tag: tE,
text: FL,
url: Ws
}, nE = {
...Zg,
link: Ot(/^!?\[(label)\]\((.*?)\)/).replace("label", Ch).getRegex(),
reflink: Ot(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", Ch).getRegex()
}, Yp = {
...Zg,
emStrongRDelimAst: qL,
emStrongLDelim: ZL,
url: Ot(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/, "i").replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),
_backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,
del: /^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,
text: /^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/
}, aE = {
...Yp,
br: Ot(CT).replace("{2,}", "*").getRegex(),
text: Ot(Yp.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
}, eu = {
normal: Ug,
gfm: VL,
pedantic: BL
}, Jo = {
normal: Zg,
gfm: Yp,
breaks: aE,
pedantic: nE
}, iE = {
"&": "&",
"<": "<",
">": ">",
'"': """,
"'": "'"
}, u0 = (r) => iE[r];
function $r(r, e) {
if (e) {
if (Re.escapeTest.test(r))
return r.replace(Re.escapeReplace, u0);
} else if (Re.escapeTestNoEncode.test(r))
return r.replace(Re.escapeReplaceNoEncode, u0);
return r;
}
function h0(r) {
try {
r = encodeURI(r).replace(Re.percentDecode, "%");
} catch {
return null;
}
return r;
}
function f0(r, e) {
var i;
const t = r.replace(Re.findPipe, (o, s, l) => {
let u = !1, h = s;
for (; --h >= 0 && l[h] === "\\"; ) u = !u;
return u ? "|" : " |";
}), n = t.split(Re.splitPipe);
let a = 0;
if (n[0].trim() || n.shift(), n.length > 0 && !((i = n.at(-1)) != null && i.trim()) && n.pop(), e)
if (n.length > e)
n.splice(e);
else
for (; n.length < e; ) n.push("");
for (; a < n.length; a++)
n[a] = n[a].trim().replace(Re.slashPipe, "|");
return n;
}
function ts(r, e, t) {
const n = r.length;
if (n === 0)
return "";
let a = 0;
for (; a < n && r.charAt(n - a - 1) === e; )
a++;
return r.slice(0, n - a);
}
function oE(r, e) {
if (r.indexOf(e[1]) === -1)
return -1;
let t = 0;
for (let n = 0; n < r.length; n++)
if (r[n] === "\\")
n++;
else if (r[n] === e[0])
t++;
else if (r[n] === e[1] && (t--, t < 0))
return n;
return t > 0 ? -2 : -1;
}
function c0(r, e, t, n, a) {
const i = e.href, o = e.title || null, s = r[1].replace(a.other.outputLinkReplace, "$1");
n.state.inLink = !0;
const l = {
type: r[0].charAt(0) === "!" ? "image" : "link",
raw: t,
href: i,
title: o,
text: s,
tokens: n.inlineTokens(s)
};
return n.state.inLink = !1, l;
}
function sE(r, e, t) {
const n = r.match(t.other.indentCodeCompensation);
if (n === null)
return e;
const a = n[1];
return e.split(`
`).map((i) => {
const o = i.match(t.other.beginningSpace);
if (o === null)
return i;
const [s] = o;
return s.length >= a.length ? i.slice(a.length) : i;
}).join(`
`);
}
var Dh = class {
// set by the lexer
constructor(r) {
Wt(this, "options");
Wt(this, "rules");
// set by the lexer
Wt(this, "lexer");
this.options = r || Mi;
}
space(r) {
const e = this.rules.block.newline.exec(r);
if (e && e[0].length > 0)
return {
type: "space",
raw: e[0]
};
}
code(r) {
const e = this.rules.block.code.exec(r);
if (e) {
const t = e[0].replace(this.rules.other.codeRemoveIndent, "");
return {
type: "code",
raw: e[0],
codeBlockStyle: "indented",
text: this.options.pedantic ? t : ts(t, `
`)
};
}
}
fences(r) {
const e = this.rules.block.fences.exec(r);
if (e) {
const t = e[0], n = sE(t, e[3] || "", this.rules);
return {
type: "code",
raw: t,
lang: e[2] ? e[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : e[2],
text: n
};
}
}
heading(r) {
const e = this.rules.block.heading.exec(r);
if (e) {
let t = e[2].trim();
if (this.rules.other.endingHash.test(t)) {
const n = ts(t, "#");
(this.options.pedantic || !n || this.rules.other.endingSpaceChar.test(n)) && (t = n.trim());
}
return {
type: "heading",
raw: e[0],
depth: e[1].length,
text: t,
tokens: this.lexer.inline(t)
};
}
}
hr(r) {
const e = this.rules.block.hr.exec(r);
if (e)
return {
type: "hr",
raw: ts(e[0], `
`)
};
}
blockquote(r) {
const e = this.rules.block.blockquote.exec(r);
if (e) {
let t = ts(e[0], `
`).split(`
`), n = "", a = "";
const i = [];
for (; t.length > 0; ) {
let o = !1;
const s = [];
let l;
for (l = 0; l < t.length; l++)
if (this.rules.other.blockquoteStart.test(t[l]))
s.push(t[l]), o = !0;
else if (!o)
s.push(t[l]);
else
break;
t = t.slice(l);
const u = s.join(`
`), h = u.replace(this.rules.other.blockquoteSetextReplace, `
$1`).replace(this.rules.other.blockquoteSetextReplace2, "");
n = n ? `${n}
${u}` : u, a = a ? `${a}
${h}` : h;
const f = this.lexer.state.top;
if (this.lexer.state.top = !0, this.lexer.blockTokens(h, i, !0), this.lexer.state.top = f, t.length === 0)
break;
const c = i.at(-1);
if ((c == null ? void 0 : c.type) === "code")
break;
if ((c == null ? void 0 : c.type) === "blockquote") {
const v = c, p = v.raw + `
` + t.join(`
`), d = this.blockquote(p);
i[i.length - 1] = d, n = n.substring(0, n.length - v.raw.length) + d.raw, a = a.substring(0, a.length - v.text.length) + d.text;
break;
} else if ((c == null ? void 0 : c.type) === "list") {
const v = c, p = v.raw + `
` + t.join(`
`), d = this.list(p);
i[i.length - 1] = d, n = n.substring(0, n.length - c.raw.length) + d.raw, a = a.substring(0, a.length - v.raw.length) + d.raw, t = p.substring(i.at(-1).raw.length).split(`
`);
continue;
}
}
return {
type: "blockquote",
raw: n,
tokens: i,
text: a
};
}
}
list(r) {
let e = this.rules.block.list.exec(r);
if (e) {
let t = e[1].trim();
const n = t.length > 1, a = {
type: "list",
raw: "",
ordered: n,
start: n ? +t.slice(0, -1) : "",
loose: !1,
items: []
};
t = n ? `\\d{1,9}\\${t.slice(-1)}` : `\\${t}`, this.options.pedantic && (t = n ? t : "[*+-]");
const i = this.rules.other.listItemRegex(t);
let o = !1;
for (; r; ) {
let l = !1, u = "", h = "";
if (!(e = i.exec(r)) || this.rules.block.hr.test(r))
break;
u = e[0], r = r.substring(u.length);
let f = e[2].split(`
`, 1)[0].replace(this.rules.other.listReplaceTabs, (y) => " ".repeat(3 * y.length)), c = r.split(`
`, 1)[0], v = !f.trim(), p = 0;
if (this.options.pedantic ? (p = 2, h = f.trimStart()) : v ? p = e[1].length + 1 : (p = e[2].search(this.rules.other.nonSpaceChar), p = p > 4 ? 1 : p, h = f.slice(p), p += e[1].length), v && this.rules.other.blankLine.test(c) && (u += c + `
`, r = r.substring(c.length + 1), l = !0), !l) {
const y = this.rules.other.nextBulletRegex(p), m = this.rules.other.hrRegex(p), _ = this.rules.other.fencesBeginRegex(p), S = this.rules.other.headingBeginRegex(p), x = this.rules.other.htmlBeginRegex(p);
for (; r; ) {
const b = r.split(`
`, 1)[0];
let w;
if (c = b, this.options.pedantic ? (c = c.replace(this.rules.other.listReplaceNesting, " "), w = c) : w = c.replace(this.rules.other.tabCharGlobal, " "), _.test(c) || S.test(c) || x.test(c) || y.test(c) || m.test(c))
break;
if (w.search(this.rules.other.nonSpaceChar) >= p || !c.trim())
h += `
` + w.slice(p);
else {
if (v || f.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || _.test(f) || S.test(f) || m.test(f))
break;
h += `
` + c;
}
!v && !c.trim() && (v = !0), u += b + `
`, r = r.substring(b.length + 1), f = w.slice(p);
}
}
a.loose || (o ? a.loose = !0 : this.rules.other.doubleBlankLine.test(u) && (o = !0));
let d = null, g;
this.options.gfm && (d = this.rules.other.listIsTask.exec(h), d && (g = d[0] !== "[ ] ", h = h.replace(this.rules.other.listReplaceTask, ""))), a.items.push({
type: "list_item",
raw: u,
task: !!d,
checked: g,
loose: !1,
text: h,
tokens: []
}), a.raw += u;
}
const s = a.items.at(-1);
if (s)
s.raw = s.raw.trimEnd(), s.text = s.text.trimEnd();
else
return;
a.raw = a.raw.trimEnd();
for (let l = 0; l < a.items.length; l++)
if (this.lexer.state.top = !1, a.items[l].tokens = this.lexer.blockTokens(a.items[l].text, []), !a.loose) {
const u = a.items[l].tokens.filter((f) => f.type === "space"), h = u.length > 0 && u.some((f) => this.rules.other.anyLine.test(f.raw));
a.loose = h;
}
if (a.loose)
for (let l = 0; l < a.items.length; l++)
a.items[l].loose = !0;
return a;
}
}
html(r) {
const e = this.rules.block.html.exec(r);
if (e)
return {
type: "html",
block: !0,
raw: e[0],
pre: e[1] === "pre" || e[1] === "script" || e[1] === "style",
text: e[0]
};
}
def(r) {
const e = this.rules.block.def.exec(r);
if (e) {
const t = e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal, " "), n = e[2] ? e[2].replace(this.rules.other.hrefBrackets, "$1").replace(this.rules.inline.anyPunctuation, "$1") : "", a = e[3] ? e[3].substring(1, e[3].length - 1).replace(this.rules.inline.anyPunctuation, "$1") : e[3];
return {
type: "def",
tag: t,
raw: e[0],
href: n,
title: a
};
}
}
table(r) {
var o;
const e = this.rules.block.table.exec(r);
if (!e || !this.rules.other.tableDelimiter.test(e[2]))
return;
const t = f0(e[1]), n = e[2].replace(this.rules.other.tableAlignChars, "").split("|"), a = (o = e[3]) != null && o.trim() ? e[3].replace(this.rules.other.tableRowBlankLine, "").split(`
`) : [], i = {
type: "table",
raw: e[0],
header: [],
align: [],
rows: []
};
if (t.length === n.length) {
for (const s of n)
this.rules.other.tableAlignRight.test(s) ? i.align.push("right") : this.rules.other.tableAlignCenter.test(s) ? i.align.push("center") : this.rules.other.tableAlignLeft.test(s) ? i.align.push("left") : i.align.push(null);
for (let s = 0; s < t.length; s++)
i.header.push({
text: t[s],
tokens: this.lexer.inline(t[s]),
header: !0,
align: i.align[s]
});
for (const s of a)
i.rows.push(f0(s, i.header.length).map((l, u) => ({
text: l,
tokens: this.lexer.inline(l),
header: !1,
align: i.align[u]
})));
return i;
}
}
lheading(r) {
const e = this.rules.block.lheading.exec(r);
if (e)
return {
type: "heading",
raw: e[0],
depth: e[2].charAt(0) === "=" ? 1 : 2,
text: e[1],
tokens: this.lexer.inline(e[1])
};
}
paragraph(r) {
const e = this.rules.block.paragraph.exec(r);
if (e) {
const t = e[1].charAt(e[1].length - 1) === `
` ? e[1].slice(0, -1) : e[1];
return {
type: "paragraph",
raw: e[0],
text: t,
tokens: this.lexer.inline(t)
};
}
}
text(r) {
const e = this.rules.block.text.exec(r);
if (e)
return {
type: "text",
raw: e[0],
text: e[0],
tokens: this.lexer.inline(e[0])
};
}
escape(r) {
const e = this.rules.inline.escape.exec(r);
if (e)
return {
type: "escape",
raw: e[0],
text: e[1]
};
}
tag(r) {
const e = this.rules.inline.tag.exec(r);
if (e)
return !this.lexer.state.inLink && this.rules.other.startATag.test(e[0]) ? this.lexer.state.inLink = !0 : this.lexer.state.inLink && this.rules.other.endATag.test(e[0]) && (this.lexer.state.inLink = !1), !this.lexer.state.inRawBlock && this.rules.other.startPreScriptTag.test(e[0]) ? this.lexer.state.inRawBlock = !0 : this.lexer.state.inRawBlock && this.rules.other.endPreScriptTag.test(e[0]) && (this.lexer.state.inRawBlock = !1), {
type: "html",
raw: e[0],
inLink: this.lexer.state.inLink,
inRawBlock: this.lexer.state.inRawBlock,
block: !1,
text: e[0]
};
}
link(r) {
const e = this.rules.inline.link.exec(r);
if (e) {
const t = e[2].trim();
if (!this.options.pedantic && this.rules.other.startAngleBracket.test(t)) {
if (!this.rules.other.endAngleBracket.test(t))
return;
const i = ts(t.slice(0, -1), "\\");
if ((t.length - i.length) % 2 === 0)
return;
} else {
const i = oE(e[2], "()");
if (i === -2)
return;
if (i > -1) {
const s = (e[0].indexOf("!") === 0 ? 5 : 4) + e[1].length + i;
e[2] = e[2].substring(0, i), e[0] = e[0].substring(0, s).trim(), e[3] = "";
}
}
let n = e[2], a = "";
if (this.options.pedantic) {
const i = this.rules.other.pedanticHrefTitle.exec(n);
i && (n = i[1], a = i[3]);
} else
a = e[3] ? e[3].slice(1, -1) : "";
return n = n.trim(), this.rules.other.startAngleBracket.test(n) && (this.options.pedantic && !this.rules.other.endAngleBracket.test(t) ? n = n.slice(1) : n = n.slice(1, -1)), c0(e, {
href: n && n.replace(this.rules.inline.anyPunctuation, "$1"),
title: a && a.replace(this.rules.inline.anyPunctuation, "$1")
}, e[0], this.lexer, this.rules);
}
}
reflink(r, e) {
let t;
if ((t = this.rules.inline.reflink.exec(r)) || (t = this.rules.inline.nolink.exec(r))) {
const n = (t[2] || t[1]).replace(this.rules.other.multipleSpaceGlobal, " "), a = e[n.toLowerCase()];
if (!a) {
const i = t[0].charAt(0);
return {
type: "text",
raw: i,
text: i
};
}
return c0(t, a, t[0], this.lexer, this.rules);
}
}
emStrong(r, e, t = "") {
let n = this.rules.inline.emStrongLDelim.exec(r);
if (!n || n[3] && t.match(this.rules.other.unicodeAlphaNumeric)) return;
if (!(n[1] || n[2] || "") || !t || this.rules.inline.punctuation.exec(t)) {
const i = [...n[0]].length - 1;
let o, s, l = i, u = 0;
const h = n[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
for (h.lastIndex = 0, e = e.slice(-1 * r.length + i); (n = h.exec(e)) != null; ) {
if (o = n[1] || n[2] || n[3] || n[4] || n[5] || n[6], !o) continue;
if (s = [...o].length, n[3] || n[4]) {
l += s;
continue;
} else if ((n[5] || n[6]) && i % 3 && !((i + s) % 3)) {
u += s;
continue;
}
if (l -= s, l > 0) continue;
s = Math.min(s, s + l + u);
const f = [...n[0]][0].length, c = r.slice(0, i + n.index + f + s);
if (Math.min(i, s) % 2) {
const p = c.slice(1, -1);
return {
type: "em",
raw: c,
text: p,
tokens: this.lexer.inlineTokens(p)
};
}
const v = c.slice(2, -2);
return {
type: "strong",
raw: c,
text: v,
tokens: this.lexer.inlineTokens(v)
};
}
}
}
codespan(r) {
const e = this.rules.inline.code.exec(r);
if (e) {
let t = e[2].replace(this.rules.other.newLineCharGlobal, " ");
const n = this.rules.other.nonSpaceChar.test(t), a = this.rules.other.startingSpaceChar.test(t) && this.rules.other.endingSpaceChar.test(t);
return n && a && (t = t.substring(1, t.length - 1)), {
type: "codespan",
raw: e[0],
text: t
};
}
}
br(r) {
const e = this.rules.inline.br.exec(r);
if (e)
return {
type: "br",
raw: e[0]
};
}
del(r) {
const e = this.rules.inline.del.exec(r);
if (e)
return {
type: "del",
raw: e[0],
text: e[2],
tokens: this.lexer.inlineTokens(e[2])
};
}
autolink(r) {
const e = this.rules.inline.autolink.exec(r);
if (e) {
let t, n;
return e[2] === "@" ? (t = e[1], n = "mailto:" + t) : (t = e[1], n = t), {
type: "link",
raw: e[0],
text: t,
href: n,
tokens: [
{
type: "text",
raw: t,
text: t
}
]
};
}
}
url(r) {
var t;
let e;
if (e = this.rules.inline.url.exec(r)) {
let n, a;
if (e[2] === "@")
n = e[0], a = "mailto:" + n;
else {
let i;
do
i = e[0], e[0] = ((t = this.rules.inline._backpedal.exec(e[0])) == null ? void 0 : t[0]) ?? "";
while (i !== e[0]);
n = e[0], e[1] === "www." ? a = "http://" + e[0] : a = e[0];
}
return {
type: "link",
raw: e[0],
text: n,
href: a,
tokens: [
{
type: "text",
raw: n,
text: n
}
]
};
}
}
inlineText(r) {
const e = this.rules.inline.text.exec(r);
if (e) {
const t = this.lexer.state.inRawBlock;
return {
type: "text",
raw: e[0],
text: e[0],
escaped: t
};
}
}
}, gn = class Zp {
constructor(e) {
Wt(this, "tokens");
Wt(this, "options");
Wt(this, "state");
Wt(this, "tokenizer");
Wt(this, "inlineQueue");
this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = e || Mi, this.options.tokenizer = this.options.tokenizer || new Dh(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = {
inLink: !1,
inRawBlock: !1,
top: !0
};
const t = {
other: Re,
block: eu.normal,
inline: Jo.normal
};
this.options.pedantic ? (t.block = eu.pedantic, t.inline = Jo.pedantic) : this.options.gfm && (t.block = eu.gfm, this.options.breaks ? t.inline = Jo.breaks : t.inline = Jo.gfm), this.tokenizer.rules = t;
}
/**
* Expose Rules
*/
static get rules() {
return {
block: eu,
inline: Jo
};
}
/**
* Static Lex Method
*/
static lex(e, t) {
return new Zp(t).lex(e);
}
/**
* Static Lex Inline Method
*/
static lexInline(e, t) {
return new Zp(t).inlineTokens(e);
}
/**
* Preprocessing
*/
lex(e) {
e = e.replace(Re.carriageReturn, `
`), this.blockTokens(e, this.tokens);
for (let t = 0; t < this.inlineQueue.length; t++) {
const n = this.inlineQueue[t];
this.inlineTokens(n.src, n.tokens);
}
return this.inlineQueue = [], this.tokens;
}
blockTokens(e, t = [], n = !1) {
var a, i, o;
for (this.options.pedantic && (e = e.replace(Re.tabCharGlobal, " ").replace(Re.spaceLine, "")); e; ) {
let s;
if ((i = (a = this.options.extensions) == null ? void 0 : a.block) != null && i.some((u) => (s = u.call({ lexer: this }, e, t)) ? (e = e.substring(s.raw.length), t.push(s), !0) : !1))
continue;
if (s = this.tokenizer.space(e)) {
e = e.substring(s.raw.length);
const u = t.at(-1);
s.raw.length === 1 && u !== void 0 ? u.raw += `
` : t.push(s);
continue;
}
if (s = this.tokenizer.code(e)) {
e = e.substring(s.raw.length);
const u = t.at(-1);
(u == null ? void 0 : u.type) === "paragraph" || (u == null ? void 0 : u.type) === "text" ? (u.raw += `
` + s.raw, u.text += `
` + s.text, this.inlineQueue.at(-1).src = u.text) : t.push(s);
continue;
}
if (s = this.tokenizer.fences(e)) {
e = e.substring(s.raw.length), t.push(s);
continue;
}
if (s = this.tokenizer.heading(e)) {
e = e.substring(s.raw.length), t.push(s);
continue;
}
if (s = this.tokenizer.hr(e)) {
e = e.substring(s.raw.length), t.push(s);
continue;
}
if (s = this.tokenizer.blockquote(e)) {
e = e.substring(s.raw.length), t.push(s);
continue;
}
if (s = this.tokenizer.list(e)) {
e = e.substring(s.raw.length), t.push(s);
continue;
}
if (s = this.tokenizer.html(e)) {
e = e.substring(s.raw.length), t.push(s);
continue;
}
if (s = this.tokenizer.def(e)) {
e = e.substring(s.raw.length);
const u = t.at(-1);
(u == null ? void 0 : u.type) === "paragraph" || (u == null ? void 0 : u.type) === "text" ? (u.raw += `
` + s.raw, u.text += `
` + s.raw, this.inlineQueue.at(-1).src = u.text) : this.tokens.links[s.tag] || (this.tokens.links[s.tag] = {
href: s.href,
title: s.title
});
continue;
}
if (s = this.tokenizer.table(e)) {
e = e.substring(s.raw.length), t.push(s);
continue;
}
if (s = this.tokenizer.lheading(e)) {
e = e.substring(s.raw.length), t.push(s);
continue;
}
let l = e;
if ((o = this.options.extensions) != null && o.startBlock) {
let u = 1 / 0;
const h = e.slice(1);
let f;
this.options.extensions.startBlock.forEach((c) => {
f = c.call({ lexer: this }, h), typeof f == "number" && f >= 0 && (u = Math.min(u, f));
}), u < 1 / 0 && u >= 0 && (l = e.substring(0, u + 1));
}
if (this.state.top && (s = this.tokenizer.paragraph(l))) {
const u = t.at(-1);
n && (u == null ? void 0 : u.type) === "paragraph" ? (u.raw += `
` + s.raw, u.text += `
` + s.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = u.text) : t.push(s), n = l.length !== e.length, e = e.substring(s.raw.length);
continue;
}
if (s = this.tokenizer.text(e)) {
e = e.substring(s.raw.length);
const u = t.at(-1);
(u == null ? void 0 : u.type) === "text" ? (u.raw += `
` + s.raw, u.text += `
` + s.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = u.text) : t.push(s);
continue;
}
if (e) {
const u = "Infinite loop on byte: " + e.charCodeAt(0);
if (this.options.silent) {
console.error(u);
break;
} else
throw new Error(u);
}
}
return this.state.top = !0, t;
}
inline(e, t = []) {
return this.inlineQueue.push({ src: e, tokens: t }), t;
}
/**
* Lexing/Compiling
*/
inlineTokens(e, t = []) {
var s, l, u;
let n = e, a = null;
if (this.tokens.links) {
const h = Object.keys(this.tokens.links);
if (h.length > 0)
for (; (a = this.tokenizer.rules.inline.reflinkSearch.exec(n)) != null; )
h.includes(a[0].slice(a[0].lastIndexOf("[") + 1, -1)) && (n = n.slice(0, a.index) + "[" + "a".repeat(a[0].length - 2) + "]" + n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex));
}
for (; (a = this.tokenizer.rules.inline.anyPunctuation.exec(n)) != null; )
n = n.slice(0, a.index) + "++" + n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
for (; (a = this.tokenizer.rules.inline.blockSkip.exec(n)) != null; )
n = n.slice(0, a.index) + "[" + "a".repeat(a[0].length - 2) + "]" + n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
let i = !1, o = "";
for (; e; ) {
i || (o = ""), i = !1;
let h;
if ((l = (s = this.options.extensions) == null ? void 0 : s.inline) != null && l.some((c) => (h = c.call({ lexer: this }, e, t)) ? (e = e.substring(h.raw.length), t.push(h), !0) : !1))
continue;
if (h = this.tokenizer.escape(e)) {
e = e.substring(h.raw.length), t.push(h);
continue;
}
if (h = this.tokenizer.tag(e)) {
e = e.substring(h.raw.length), t.push(h);
continue;
}
if (h = this.tokenizer.link(e)) {
e = e.substring(h.raw.length), t.push(h);
continue;
}
if (h = this.tokenizer.reflink(e, this.tokens.links)) {
e = e.substring(h.raw.length);
const c = t.at(-1);
h.type === "text" && (c == null ? void 0 : c.type) === "text" ? (c.raw += h.raw, c.text += h.text) : t.push(h);
continue;
}
if (h = this.tokenizer.emStrong(e, n, o)) {
e = e.substring(h.raw.length), t.push(h);
continue;
}
if (h = this.tokenizer.codespan(e)) {
e = e.substring(h.raw.length), t.push(h);
continue;
}
if (h = this.tokenizer.br(e)) {
e = e.substring(h.raw.length), t.push(h);
continue;
}
if (h = this.tokenizer.del(e)) {
e = e.substring(h.raw.length), t.push(h);
continue;
}
if (h = this.tokenizer.autolink(e)) {
e = e.substring(h.raw.length), t.push(h);
continue;
}
if (!this.state.inLink && (h = this.tokenizer.url(e))) {
e = e.substring(h.raw.length), t.push(h);
continue;
}
let f = e;
if ((u = this.options.extensions) != null && u.startInline) {
let c = 1 / 0;
const v = e.slice(1);
let p;
this.options.extensions.startInline.forEach((d) => {
p = d.call({ lexer: this }, v), typeof p == "number" && p >= 0 && (c = Math.min(c, p));
}), c < 1 / 0 && c >= 0 && (f = e.substring(0, c + 1));
}
if (h = this.tokenizer.inlineText(f)) {
e = e.substring(h.raw.length), h.raw.slice(-1) !== "_" && (o = h.raw.slice(-1)), i = !0;
const c = t.at(-1);
(c == null ? void 0 : c.type) === "text" ? (c.raw += h.raw, c.text += h.text) : t.push(h);
continue;
}
if (e) {
const c = "Infinite loop on byte: " + e.charCodeAt(0);
if (this.options.silent) {
console.error(c);
break;
} else
throw new Error(c);
}
}
return t;
}
}, Ah = class {
// set by the parser
constructor(r) {
Wt(this, "options");
Wt(this, "parser");
this.options = r || Mi;
}
space(r) {
return "";
}
code({ text: r, lang: e, escaped: t }) {
var i;
const n = (i = (e || "").match(Re.notSpaceStart)) == null ? void 0 : i[0], a = r.replace(Re.endingNewline, "") + `
`;
return n ? '<pre><code class="language-' + $r(n) + '">' + (t ? a : $r(a, !0)) + `</code></pre>
` : "<pre><code>" + (t ? a : $r(a, !0)) + `</code></pre>
`;
}
blockquote({ tokens: r }) {
return `<blockquote>
${this.parser.parse(r)}</blockquote>
`;
}
html({ text: r }) {
return r;
}
heading({ tokens: r, depth: e }) {
return `<h${e}>${this.parser.parseInline(r)}</h${e}>
`;
}
hr(r) {
return `<hr>
`;
}
list(r) {
const e = r.ordered, t = r.start;
let n = "";
for (let o = 0; o < r.items.length; o++) {
const s = r.items[o];
n += this.listitem(s);
}
const a = e ? "ol" : "ul", i = e && t !== 1 ? ' start="' + t + '"' : "";
return "<" + a + i + `>
` + n + "</" + a + `>
`;
}
listitem(r) {
var t;
let e = "";
if (r.task) {
const n = this.checkbox({ checked: !!r.checked });
r.loose ? ((t = r.tokens[0]) == null ? void 0 : t.type) === "paragraph" ? (r.tokens[0].text = n + " " + r.tokens[0].text, r.tokens[0].tokens && r.tokens[0].tokens.length > 0 && r.tokens[0].tokens[0].type === "text" && (r.tokens[0].tokens[0].text = n + " " + $r(r.tokens[0].tokens[0].text), r.tokens[0].tokens[0].escaped = !0)) : r.tokens.unshift({
type: "text",
raw: n + " ",
text: n + " ",
escaped: !0
}) : e += n + " ";
}
return e += this.parser.parse(r.tokens, !!r.loose), `<li>${e}</li>
`;
}
checkbox({ checked: r }) {
return "<input " + (r ? 'checked="" ' : "") + 'disabled="" type="checkbox">';
}
paragraph({ tokens: r }) {
return `<p>${this.parser.parseInline(r)}</p>
`;
}
table(r) {
let e = "", t = "";
for (let a = 0; a < r.header.length; a++)
t += this.tablecell(r.header[a]);
e += this.tablerow({ text: t });
let n = "";
for (let a = 0; a < r.rows.length; a++) {
const i = r.rows[a];
t = "";
for (let o = 0; o < i.length; o++)
t += this.tablecell(i[o]);
n += this.tablerow({ text: t });
}
return n && (n = `<tbody>${n}</tbody>`), `<table>
<thead>
` + e + `</thead>
` + n + `</table>
`;
}
tablerow({ text: r }) {
return `<tr>
${r}</tr>
`;
}
tablecell(r) {
const e = this.parser.parseInline(r.tokens), t = r.header ? "th" : "td";
return (r.align ? `<${t} align="${r.align}">` : `<${t}>`) + e + `</${t}>
`;
}
/**
* span level renderer
*/
strong({ tokens: r }) {
return `<strong>${this.parser.parseInline(r)}</strong>`;
}
em({ tokens: r }) {
return `<em>${this.parser.parseInline(r)}</em>`;
}
codespan({ text: r }) {
return `<code>${$r(r, !0)}</code>`;
}
br(r) {
return "<br>";
}
del({ tokens: r }) {
return `<del>${this.parser.parseInline(r)}</del>`;
}
link({ href: r, title: e, tokens: t }) {
const n = this.parser.parseInline(t), a = h0(r);
if (a === null)
return n;
r = a;
let i = '<a href="' + r + '"';
return e && (i += ' title="' + $r(e) + '"'), i += ">" + n + "</a>", i;
}
image({ href: r, title: e, text: t, tokens: n }) {
n && (t = this.parser.parseInline(n, this.parser.textRenderer));
const a = h0(r);
if (a === null)
return $r(t);
r = a;
let i = `<img src="${r}" alt="${t}"`;
return e && (i += ` title="${$r(e)}"`), i += ">", i;
}
text(r) {
return "tokens" in r && r.tokens ? this.parser.parseInline(r.tokens) : "escaped" in r && r.escaped ? r.text : $r(r.text);
}
}, Xg = class {
// no need for block level renderers
strong({ text: r }) {
return r;
}
em({ text: r }) {
return r;
}
codespan({ text: r }) {
return r;
}
del({ text: r }) {
return r;
}
html({ text: r }) {
return r;
}
text({ text: r }) {
return r;
}
link({ text: r }) {
return "" + r;
}
image({ text: r }) {
return "" + r;
}
br() {
return "";
}
}, yn = class Xp {
constructor(e) {
Wt(this, "options");
Wt(this, "renderer");
Wt(this, "textRenderer");
this.options = e || Mi, this.options.renderer = this.options.renderer || new Ah(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new Xg();
}
/**
* Static Parse Method
*/
static parse(e, t) {
return new Xp(t).parse(e);
}
/**
* Static Parse Inline Method
*/
static parseInline(e, t) {
return new Xp(t).parseInline(e);
}
/**
* Parse Loop
*/
parse(e, t = !0) {
var a, i;
let n = "";
for (let o = 0; o < e.length; o++) {
const s = e[o];
if ((i = (a = this.options.extensions) == null ? void 0 : a.renderers) != null && i[s.type]) {
const u = s, h = this.options.extensions.renderers[u.type].call({ parser: this }, u);
if (h !== !1 || !["space", "hr", "heading", "code", "table", "blockquote", "list", "html", "paragraph", "text"].includes(u.type)) {
n += h || "";
continue;
}
}
const l = s;
switch (l.type) {
case "space": {
n += this.renderer.space(l);
continue;
}
case "hr": {
n += this.renderer.hr(l);
continue;
}
case "heading": {
n += this.renderer.heading(l);
continue;
}
case "code": {
n += this.renderer.code(l);
continue;
}
case "table": {
n += this.renderer.table(l);
continue;
}
case "blockquote": {
n += this.renderer.blockquote(l);
continue;
}
case "list": {
n += this.renderer.list(l);
continue;
}
case "html": {
n += this.renderer.html(l);
continue;
}
case "paragraph": {
n += this.renderer.paragraph(l);
continue;
}
case "text": {
let u = l, h = this.renderer.text(u);
for (; o + 1 < e.length && e[o + 1].type === "text"; )
u = e[++o], h += `
` + this.renderer.text(u);
t ? n += this.renderer.paragraph({
type: "paragraph",
raw: h,
text: h,
tokens: [{ type: "text", raw: h, text: h, escaped: !0 }]
}) : n += h;
continue;
}
default: {
const u = 'Token with "' + l.type + '" type was not found.';
if (this.options.silent)
return console.error(u), "";
throw new Error(u);
}
}
}
return n;
}
/**
* Parse Inline Tokens
*/
parseInline(e, t = this.renderer) {
var a, i;
let n = "";
for (let o = 0; o < e.length; o++) {
const s = e[o];
if ((i = (a = this.options.extensions) == null ? void 0 : a.renderers) != null && i[s.type]) {
const u = this.options.extensions.renderers[s.type].call({ parser: this }, s);
if (u !== !1 || !["escape", "html", "link", "image", "strong", "em", "codespan", "br", "del", "text"].includes(s.type)) {
n += u || "";
continue;
}
}
const l = s;
switch (l.type) {
case "escape": {
n += t.text(l);
break;
}
case "html": {
n += t.html(l);
break;
}
case "link": {
n += t.link(l);
break;
}
case "image": {
n += t.image(l);
break;
}
case "strong": {
n += t.strong(l);
break;
}
case "em": {
n += t.em(l);
break;
}
case "codespan": {
n += t.codespan(l);
break;
}
case "br": {
n += t.br(l);
break;
}
case "del": {
n += t.del(l);
break;
}
case "text": {
n += t.text(l);
break;
}
default: {
const u = 'Token with "' + l.type + '" type was not found.';
if (this.options.silent)
return console.error(u), "";
throw new Error(u);
}
}
}
return n;
}
}, Up, nh = (Up = class {
constructor(r) {
Wt(this, "options");
Wt(this, "block");
this.options = r || Mi;
}
/**
* Process markdown before marked
*/
preprocess(r) {
return r;
}
/**
* Process HTML after marked is finished
*/
postprocess(r) {
return r;
}
/**
* Process all tokens before walk tokens
*/
processAllTokens(r) {
return r;
}
/**
* Provide function to tokenize markdown
*/
provideLexer() {
return this.block ? gn.lex : gn.lexInline;
}
/**
* Provide function to parse tokens
*/
provideParser() {
return this.block ? yn.parse : yn.parseInline;
}
}, Wt(Up, "passThroughHooks", /* @__PURE__ */ new Set([
"preprocess",
"postprocess",
"processAllTokens"
])), Up), lE = class {
constructor(...r) {
Wt(this, "defaults", Gg());
Wt(this, "options", this.setOptions);
Wt(this, "parse", this.parseMarkdown(!0));
Wt(this, "parseInline", this.parseMarkdown(!1));
Wt(this, "Parser", yn);
Wt(this, "Renderer", Ah);
Wt(this, "TextRenderer", Xg);
Wt(this, "Lexer", gn);
Wt(this, "Tokenizer", Dh);
Wt(this, "Hooks", nh);
this.use(...r);
}
/**
* Run callback for every token
*/
walkTokens(r, e) {
var n, a;
let t = [];
for (const i of r)
switch (t = t.concat(e.call(this, i)), i.type) {
case "table": {
const o = i;
for (const s of o.header)
t = t.concat(this.walkTokens(s.tokens, e));
for (const s of o.rows)
for (const l of s)
t = t.concat(this.walkTokens(l.tokens, e));
break;
}
case "list": {
const o = i;
t = t.concat(this.walkTokens(o.items, e));
break;
}
default: {
const o = i;
(a = (n = this.defaults.extensions) == null ? void 0 : n.childTokens) != null && a[o.type] ? this.defaults.extensions.childTokens[o.type].forEach((s) => {
const l = o[s].flat(1 / 0);
t = t.concat(this.walkTokens(l, e));
}) : o.tokens && (t = t.concat(this.walkTokens(o.tokens, e)));
}
}
return t;
}
use(...r) {
const e = this.defaults.extensions || { renderers: {}, childTokens: {} };
return r.forEach((t) => {
const n = { ...t };
if (n.async = this.defaults.async || n.async || !1, t.extensions && (t.extensions.forEach((a) => {
if (!a.name)
throw new Error("extension name required");
if ("renderer" in a) {
const i = e.renderers[a.name];
i ? e.renderers[a.name] = function(...o) {
let s = a.renderer.apply(this, o);
return s === !1 && (s = i.apply(this, o)), s;
} : e.renderers[a.name] = a.renderer;
}
if ("tokenizer" in a) {
if (!a.level || a.level !== "block" && a.level !== "inline")
throw new Error("extension level must be 'block' or 'inline'");
const i = e[a.level];
i ? i.unshift(a.tokenizer) : e[a.level] = [a.tokenizer], a.start && (a.level === "block" ? e.startBlock ? e.startBlock.push(a.start) : e.startBlock = [a.start] : a.level === "inline" && (e.startInline ? e.startInline.push(a.start) : e.startInline = [a.start]));
}
"childTokens" in a && a.childTokens && (e.childTokens[a.name] = a.childTokens);
}), n.extensions = e), t.renderer) {
const a = this.defaults.renderer || new Ah(this.defaults);
for (const i in t.renderer) {
if (!(i in a))
throw new Error(`renderer '${i}' does not exist`);
if (["options", "parser"].includes(i))
continue;
const o = i, s = t.renderer[o], l = a[o];
a[o] = (...u) => {
let h = s.apply(a, u);
return h === !1 && (h = l.apply(a, u)), h || "";
};
}
n.renderer = a;
}
if (t.tokenizer) {
const a = this.defaults.tokenizer || new Dh(this.defaults);
for (const i in t.tokenizer) {
if (!(i in a))
throw new Error(`tokenizer '${i}' does not exist`);
if (["options", "rules", "lexer"].includes(i))
continue;
const o = i, s = t.tokenizer[o], l = a[o];
a[o] = (...u) => {
let h = s.apply(a, u);
return h === !1 && (h = l.apply(a, u)), h;
};
}
n.tokenizer = a;
}
if (t.hooks) {
const a = this.defaults.hooks || new nh();
for (const i in t.hooks) {
if (!(i in a))
throw new Error(`hook '${i}' does not exist`);
if (["options", "block"].includes(i))
continue;
const o = i, s = t.hooks[o], l = a[o];
nh.passThroughHooks.has(i) ? a[o] = (u) => {
if (this.defaults.async)
return Promise.resolve(s.call(a, u)).then((f) => l.call(a, f));
const h = s.call(a, u);
return l.call(a, h);
} : a[o] = (...u) => {
let h = s.apply(a, u);
return h === !1 && (h = l.apply(a, u)), h;
};
}
n.hooks = a;
}
if (t.walkTokens) {
const a = this.defaults.walkTokens, i = t.walkTokens;
n.walkTokens = function(o) {
let s = [];
return s.push(i.call(this, o)), a && (s = s.concat(a.call(this, o))), s;
};
}
this.defaults = { ...this.defaults, ...n };
}), this;
}
setOptions(r) {
return this.defaults = { ...this.defaults, ...r }, this;
}
lexer(r, e) {
return gn.lex(r, e ?? this.defaults);
}
parser(r, e) {
return yn.parse(r, e ?? this.defaults);
}
parseMarkdown(r) {
return (t, n) => {
const a = { ...n }, i = { ...this.defaults, ...a }, o = this.onError(!!i.silent, !!i.async);
if (this.defaults.async === !0 && a.async === !1)
return o(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));
if (typeof t > "u" || t === null)
return o(new Error("marked(): input parameter is undefined or null"));
if (typeof t != "string")
return o(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(t) + ", string expected"));
i.hooks && (i.hooks.options = i, i.hooks.block = r);
const s = i.hooks ? i.hooks.provideLexer() : r ? gn.lex : gn.lexInline, l = i.hooks ? i.hooks.provideParser() : r ? yn.parse : yn.parseInline;
if (i.async)
return Promise.resolve(i.hooks ? i.hooks.preprocess(t) : t).then((u) => s(u, i)).then((u) => i.hooks ? i.hooks.processAllTokens(u) : u).then((u) => i.walkTokens ? Promise.all(this.walkTokens(u, i.walkTokens)).then(() => u) : u).then((u) => l(u, i)).then((u) => i.hooks ? i.hooks.postprocess(u) : u).catch(o);
try {
i.hooks && (t = i.hooks.preprocess(t));
let u = s(t, i);
i.hooks && (u = i.hooks.processAllTokens(u)), i.walkTokens && this.walkTokens(u, i.walkTokens);
let h = l(u, i);
return i.hooks && (h = i.hooks.postprocess(h)), h;
} catch (u) {
return o(u);
}
};
}
onError(r, e) {
return (t) => {
if (t.message += `
Please report this to https://github.com/markedjs/marked.`, r) {
const n = "<p>An error occurred:</p><pre>" + $r(t.message + "", !0) + "</pre>";
return e ? Promise.resolve(n) : n;
}
if (e)
return Promise.reject(t);
throw t;
};
}
}, mi = new lE();
function zt(r, e) {
return mi.parse(r, e);
}
zt.options = zt.setOptions = function(r) {
return mi.setOptions(r), zt.defaults = mi.defaults, xT(zt.defaults), zt;
};
zt.getDefaults = Gg;
zt.defaults = Mi;
zt.use = function(...r) {
return mi.use(...r), zt.defaults = mi.defaults, xT(zt.defaults), zt;
};
zt.walkTokens = function(r, e) {
return mi.walkTokens(r, e);
};
zt.parseInline = mi.parseInline;
zt.Parser = yn;
zt.parser = yn.parse;
zt.Renderer = Ah;
zt.TextRenderer = Xg;
zt.Lexer = gn;
zt.lexer = gn.lex;
zt.Tokenizer = Dh;
zt.Hooks = nh;
zt.parse = zt;
zt.options;
zt.setOptions;
zt.use;
zt.walkTokens;
zt.parseInline;
yn.parse;
gn.lex;
const uE = {
name: "LznLoading",
props: {
// loading大小
size: {
type: Number,
default: 18
},
// loading颜色
color: {
type: String,
default: "#1677ff"
},
// loading旁边的文字
txt: {
type: String,
default: ""
}
}
}, hE = { class: "l-loading-container" }, fE = { class: "l-loading-txt" };
function cE(r, e, t, n, a, i) {
return Ie(), Ye("div", hE, [
Kt("div", {
class: "l-circle-container",
style: lo({ width: `${t.size}px`, height: `${t.size}px` })
}, [
Kt("div", {
class: "l-circle",
style: lo({ backgroundColor: t.color })
}, null, 4),
Kt("div", {
class: "l-circle",
style: lo({ backgroundColor: t.color })
}, null, 4),
Kt("div", {
class: "l-circle",
style: lo({ backgroundColor: t.color })
}, null, 4),
Kt("div", {
class: "l-circle",
style: lo({ backgroundColor: t.color })
}, null, 4)
], 4),
Kt("span", fE, yL(t.txt), 1)
]);
}
const vE = /* @__PURE__ */ Pl(uE, [["render", cE]]);
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
var qp = function(r, e) {
return qp = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t, n) {
t.__proto__ = n;
} || function(t, n) {
for (var a in n) Object.prototype.hasOwnProperty.call(n, a) && (t[a] = n[a]);
}, qp(r, e);
};
function O(r, e) {
if (typeof e != "function" && e !== null)
throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
qp(r, e);
function t() {
this.constructor = r;
}
r.prototype = e === null ? Object.create(e) : (t.prototype = e.prototype, new t());
}
var pE = /* @__PURE__ */ function() {
function r() {
this.firefox = !1, this.ie = !1, this.edge = !1, this.newEdge = !1, this.weChat = !1;
}
return r;
}(), dE = /* @__PURE__ */ function() {
function r() {
this.browser = new pE(), this.node = !1, this.wxa = !1, this.worker = !1, this.svgSupported = !1, this.touchEventsSupported = !1, this.pointerEventsSupported = !1, this.domSupported = !1, this.transformSupported = !1, this.transform3dSupported = !1, this.hasGlobalWindow = typeof window < "u";
}
return r;
}(), yt = new dE();
typeof wx == "object" && typeof wx.getSystemInfoSync == "function" ? (yt.wxa = !0, yt.touchEventsSupported = !0) : typeof document > "u" && typeof self < "u" ? yt.worker = !0 : !yt.hasGlobalWindow || "Deno" in window ? (yt.node = !0, yt.svgSupported = !0) : gE(navigator.userAgent, yt);
function gE(r, e) {
var t = e.browser, n = r.match(/Firefox\/([\d.]+)/), a = r.match(/MSIE\s([\d.]+)/) || r.match(/Trident\/.+?rv:(([\d.]+))/), i = r.match(/Edge?\/([\d.]+)/), o = /micromessenger/i.test(r);
n && (t.firefox = !0, t.version = n[1]), a && (t.ie = !0, t.version = a[1]), i && (t.edge = !0, t.version = i[1], t.newEdge = +i[1].split(".")[0] > 18), o && (t.weChat = !0), e.svgSupported = typeof SVGRect < "u", e.touchEventsSupported = "ontouchstart" in window && !t.ie && !t.edge, e.pointerEventsSupported = "onpointerdown" in window && (t.edge || t.ie && +t.version >= 11), e.domSupported = typeof document < "u";
var s = document.documentElement.style;
e.transform3dSupported = (t.ie && "transition" in s || t.edge || "WebKitCSSMatrix" in window && "m11" in new WebKitCSSMatrix() || "MozPerspective" in s) && !("OTransition" in s), e.transformSupported = e.transform3dSupported || t.ie && +t.version >= 9;
}
var qg = 12, PT = "sans-serif", ua = qg + "px " + PT, yE = 20, mE = 100, _E = "007LLmW'55;N0500LLLLLLLLLL00NNNLzWW\\\\WQb\\0FWLg\\bWb\\WQ\\WrWWQ000CL5LLFLL0LL**F*gLLLL5F0LF\\FFF5.5N";
function SE(r) {
var e = {};
if (typeof JSON > "u")
return e;
for (var t = 0; t < r.length; t++) {
var n = String.fromCharCode(t + 32), a = (r.charCodeAt(t) - yE) / mE;
e[n] = a;
}
return e;
}
var xE = SE(_E), ha = {
createCanvas: function() {
return typeof document < "u" && document.createElement("canvas");
},
measureText: /* @__PURE__ */ function() {
var r, e;
return function(t, n) {
if (!r) {
var a = ha.createCanvas();
r = a && a.getContext("2d");
}
if (r)
return e !== n && (e = r.font = n || ua), r.measureText(t);
t = t || "", n = n || ua;
var i = /((?:\d+)?\.?\d*)px/.exec(n), o = i && +i[1] || qg, s = 0;
if (n.indexOf("mono") >= 0)
s = o * t.length;
else
for (var l = 0; l < t.length; l++) {
var u = xE[t[l]];
s += u == null ? o : u * o;
}
return { width: s };
};
}(),
loadImage: function(r, e, t) {
var n = new Image();
return n.onload = e, n.onerror = t, n.src = r, n;
}
}, kT = rn([
"Function",
"RegExp",
"Date",
"Error",
"CanvasGradient",
"CanvasPattern",
"Image",
"Canvas"
], function(r, e) {
return r["[object " + e + "]"] = !0, r;
}, {}), RT = rn([
"Int8",
"Uint8",
"Uint8Clamped",
"Int16",
"Uint16",
"Int32",
"Uint32",
"Float32",
"Float64"
], function(r, e) {
return r["[object " + e + "Array]"] = !0, r;
}, {}), No = Object.prototype.toString, Lf = Array.prototype, bE = Lf.forEach, wE = Lf.filter, Kg = Lf.slice, TE = Lf.map, v0 = (function() {
}).constructor, ru = v0 ? v0.prototype : null, jg = "__proto__", CE = 2311;
function NT() {
return CE++;
}
function Er() {
for (var r = [], e = 0; e < arguments.length; e++)
r[e] = arguments[e];
typeof console < "u" && console.error.apply(console, r);
}
function nt(r) {
if (r == null || typeof r != "object")
return r;
var e = r, t = No.call(r);
if (t === "[object Array]") {
if (!$s(r)) {
e = [];
for (var n = 0, a = r.length; n < a; n++)
e[n] = nt(r[n]);
}
} else if (RT[t]) {
if (!$s(r)) {
var i = r.constructor;
if (i.from)
e = i.from(r);
else {
e = new i(r.length);
for (var n = 0, a = r.length; n < a; n++)
e[n] = r[n];
}
}
} else if (!kT[t] && !$s(r) && !_i(r)) {
e = {};
for (var o in r)
r.hasOwnProperty(o) && o !== jg && (e[o] = nt(r[o]));
}
return e;
}
function ht(r, e, t) {
if (!J(e) || !J(r))
return t ? nt(e) : r;
for (var n in e)
if (e.hasOwnProperty(n) && n !== jg) {
var a = r[n], i = e[n];
J(i) && J(a) && !z(i) && !z(a) && !_i(i) && !_i(a) && !p0(i) && !p0(a) && !$s(i) && !$s(a) ? ht(a, i, t) : (t || !(n in r)) && (r[n] = nt(e[n]));
}
return r;
}
function Qg(r, e) {
for (var t = r[0], n = 1, a = r.length; n < a; n++)
t = ht(t, r[n], e);
return t;
}
function B(r, e) {
if (Object.assign)
Object.assign(r, e);
else
for (var t in e)
e.hasOwnProperty(t) && t !== jg && (r[t] = e[t]);
return r;
}
function et(r, e, t) {
for (var n = St(e), a = 0, i = n.length; a < i; a++) {
var o = n[a];
(t ? e[o] != null : r[o] == null) && (r[o] = e[o]);
}
return r;
}
function pt(r, e) {
if (r) {
if (r.indexOf)
return r.indexOf(e);
for (var t = 0, n = r.length; t < n; t++)
if (r[t] === e)
return t;
}
return -1;
}
function DE(r, e) {
var t = r.prototype;
function n() {
}
n.prototype = e.prototype, r.prototype = new n();
for (var a in t)
t.hasOwnProperty(a) && (r.prototype[a] = t[a]);
r.prototype.constructor = r, r.superClass = e;
}
function ie(r, e, t) {
if (r = "prototype" in r ? r.prototype : r, e = "prototype" in e ? e.prototype : e, Object.getOwnPropertyNames)
for (var n = Object.getOwnPropertyNames(e), a = 0; a < n.length; a++) {
var i = n[a];
i !== "constructor" && (t ? e[i] != null : r[i] == null) && (r[i] = e[i]);
}
else
et(r, e, t);
}
function De(r) {
return !r || typeof r == "string" ? !1 : typeof r.length == "number";
}
function A(r, e, t) {
if (r && e)
if (r.forEach && r.forEach === bE)
r.forEach(e, t);
else if (r.length === +r.length)
for (var n = 0, a = r.length; n < a; n++)
e.call(t, r[n], n, r);
else
for (var i in r)
r.hasOwnProperty(i) && e.call(t, r[i], i, r);
}
function G(r, e, t) {
if (!r)
return [];
if (!e)
return Jg(r);
if (r.map && r.map === TE)
return r.map(e, t);
for (var n = [], a = 0, i = r.length; a < i; a++)
n.push(e.call(t, r[a], a, r));
return n;
}
function rn(r, e, t, n) {
if (r && e) {
for (var a = 0, i = r.length; a < i; a++)
t = e.call(n, t, r[a], a, r);
return t;
}
}
function At(r, e, t) {
if (!r)
return [];
if (!e)
return Jg(r);
if (r.filter && r.filter === wE)
return r.filter(e, t);
for (var n = [], a = 0, i = r.length; a < i; a++)
e.call(t, r[a], a, r) && n.push(r[a]);
return n;
}
function AE(r, e, t) {
if (r && e) {
for (var n = 0, a = r.length; n < a; n++)
if (e.call(t, r[n], n, r))
return r[n];
}
}
function St(r) {
if (!r)
return [];
if (Object.keys)
return Object.keys(r);
var e = [];
for (var t in r)
r.hasOwnProperty(t) && e.push(t);
return e;
}
function ME(r, e) {
for (var t = [], n = 2; n < arguments.length; n++)
t[n - 2] = arguments[n];
return function() {
return r.apply(e, t.concat(Kg.call(arguments)));
};
}
var Y = ru && K(ru.bind) ? ru.call.bind(ru.bind) : ME;
function ut(r) {
for (var e = [], t = 1; t < arguments.length; t++)
e[t - 1] = arguments[t];
return function() {
return r.apply(this, e.concat(Kg.call(arguments)));
};
}
function z(r) {
return Array.isArray ? Array.isArray(r) : No.call(r) === "[object Array]";
}
function K(r) {
return typeof r == "function";
}
function U(r) {
return typeof r == "string";
}
function Mh(r) {
return No.call(r) === "[object String]";
}
function Tt(r) {
return typeof r == "number";
}
function J(r) {
var e = typeof r;
return e === "function" || !!r && e === "object";
}
function p0(r) {
return !!kT[No.call(r)];
}
function Ve(r) {
return !!RT[No.call(r)];
}
function _i(r) {
return typeof r == "object" && typeof r.nodeType == "number" && typeof r.ownerDocument == "object";
}
function Ef(r) {
return r.colorStops != null;
}
function IE(r) {
return r.image != null;
}
function OT(r) {
return No.call(r) === "[object RegExp]";
}
function Si(r) {
return r !== r;
}
function re() {
for (var r = [], e = 0; e < arguments.length; e++)
r[e] = arguments[e];
for (var t = 0, n = r.length; t < n; t++)
if (r[t] != null)
return r[t];
}
function ot(r, e) {
return r ?? e;
}
function mr(r, e, t) {
return r ?? e ?? t;
}
function Jg(r) {
for (var e = [], t = 1; t < arguments.length; t++)
e[t - 1] = arguments[t];
return Kg.apply(r, e);
}
function ty(r) {
if (typeof r == "number")
return [r, r, r, r];
var e = r.length;
return e === 2 ? [r[0], r[1], r[0], r[1]] : e === 3 ? [r[0], r[1], r[2], r[1]] : r;
}
function tt(r, e) {
if (!r)
throw new Error(e);
}
function Ir(r) {
return r == null ? null : typeof r.trim == "function" ? r.trim() : r.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
}
var VT = "__ec_primitive__";
function Ih(r) {
r[VT] = !0;
}
function $s(r) {
return r[VT];
}
var LE = function() {
function r() {
this.data = {};
}
return r.prototype.delete = function(e) {
var t = this.has(e);
return t && delete this.data[e], t;
}, r.prototype.has = function(e) {
return this.data.hasOwnProperty(e);
}, r.prototype.get = function(e) {
return this.data[e];
}, r.prototype.set = function(e, t) {
return this.data[e] = t, this;
}, r.prototype.keys = function() {
return St(this.data);
}, r.prototype.forEach = function(e) {
var t = this.data;
for (var n in t)
t.hasOwnProperty(n) && e(t[n], n);
}, r;
}(), BT = typeof Map == "function";
function EE() {
return BT ? /* @__PURE__ */ new Map() : new LE();
}
var PE = function() {
function r(e) {
var t = z(e);
this.data = EE();
var n = this;
e instanceof r ? e.each(a) : e && A(e, a);
function a(i, o) {
t ? n.set(i, o) : n.set(o, i);
}
}
return r.prototype.hasKey = function(e) {
return this.data.has(e);
}, r.prototype.get = function(e) {
return this.data.get(e);
}, r.prototype.set = function(e, t) {
return this.data.set(e, t), t;
}, r.prototype.each = function(e, t) {
this.data.forEach(function(n, a) {
e.call(t, n, a);
});
}, r.prototype.keys = function() {
var e = this.data.keys();
return BT ? Array.from(e) : e;
}, r.prototype.removeKey = function(e) {
this.data.delete(e);
}, r;
}();
function X(r) {
return new PE(r);
}
function ol(r, e) {
for (var t = new r.constructor(r.length + e.length), n = 0; n < r.length; n++)
t[n] = r[n];
for (var a = r.length, n = 0; n < e.length; n++)
t[n + a] = e[n];
return t;
}
function Pf(r, e) {
var t;
if (Object.create)
t = Object.create(r);
else {
var n = function() {
};
n.prototype = r, t = new n();
}
return e && B(t, e), t;
}
function zT(r) {
var e = r.style;
e.webkitUserSelect = "none", e.userSelect = "none", e.webkitTapHighlightColor = "rgba(0,0,0,0)", e["-webkit-touch-callout"] = "none";
}
function Z(r, e) {
return r.hasOwnProperty(e);
}
function Jt() {
}
var ah = 180 / Math.PI;
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
var Kp = function(r, e) {
return Kp = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t, n) {
t.__proto__ = n;
} || function(t, n) {
for (var a in n) Object.prototype.hasOwnProperty.call(n, a) && (t[a] = n[a]);
}, Kp(r, e);
};
function Ht(r, e) {
if (typeof e != "function" && e !== null)
throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
Kp(r, e);
function t() {
this.constructor = r;
}
r.prototype = e === null ? Object.create(e) : (t.prototype = e.prototype, new t());
}
function Ii(r, e) {
return r == null && (r = 0), e == null && (e = 0), [r, e];
}
function Le(r, e) {
return r[0] = e[0], r[1] = e[1], r;
}
function Sn(r) {
return [r[0], r[1]];
}
function kE(r, e, t) {
return r[0] = e, r[1] = t, r;
}
function d0(r, e, t) {
return r[0] = e[0] + t[0], r[1] = e[1] + t[1], r;
}
function jp(r, e, t, n) {
return r[0] = e[0] + t[0] * n, r[1] = e[1] + t[1] * n, r;
}
function ei(r, e, t) {
return r[0] = e[0] - t[0], r[1] = e[1] - t[1], r;
}
function Qp(r) {
return Math.sqrt(RE(r));
}
function RE(r) {
return r[0] * r[0] + r[1] * r[1];
}
function ih(r, e, t) {
return r[0] = e[0] * t, r[1] = e[1] * t, r;
}
function Oo(r, e) {
var t = Qp(e);
return t === 0 ? (r[0] = 0, r[1] = 0) : (r[0] = e[0] / t, r[1] = e[1] / t), r;
}
function Jp(r, e) {
return Math.sqrt((r[0] - e[0]) * (r[0] - e[0]) + (r[1] - e[1]) * (r[1] - e[1]));
}
var jn = Jp;
function NE(r, e) {
return (r[0] - e[0]) * (r[0] - e[0]) + (r[1] - e[1]) * (r[1] - e[1]);
}
var ui = NE;
function oh(r, e, t, n) {
return r[0] = e[0] + n * (t[0] - e[0]), r[1] = e[1] + n * (t[1] - e[1]), r;
}
function me(r, e, t) {
var n = e[0], a = e[1];
return r[0] = t[0] * n + t[2] * a + t[4], r[1] = t[1] * n + t[3] * a + t[5], r;
}
function Qn(r, e, t) {
return r[0] = Math.min(e[0], t[0]), r[1] = Math.min(e[1], t[1]), r;
}
function Jn(r, e, t) {
return r[0] = Math.max(e[0], t[0]), r[1] = Math.max(e[1], t[1]), r;
}
var Bi = /* @__PURE__ */ function() {
function r(e, t) {
this.target = e, this.topTarget = t && t.topTarget;
}
return r;
}(), OE = function() {
function r(e) {
this.handler = e, e.on("mousedown", this._dragStart, this), e.on("mousemove", this._drag, this), e.on("mouseup", this._dragEnd, this);
}
return r.prototype._dragStart = function(e) {
for (var t = e.target; t && !t.draggable; )
t = t.parent || t.__hostTarget;
t && (this._draggingTarget = t, t.dragging = !0, this._x = e.offsetX, this._y = e.offsetY, this.handler.dispatchToElement(new Bi(t, e), "dragstart", e.event));
}, r.prototype._drag = function(e) {
var t = this._draggingTarget;
if (t) {
var n = e.offsetX, a = e.offsetY, i = n - this._x, o = a - this._y;
this._x = n, this._y = a, t.drift(i, o, e), this.handler.dispatchToElement(new Bi(t, e), "drag", e.event);
var s = this.handler.findHover(n, a, t).target, l = this._dropTarget;
this._dropTarget = s, t !== s && (l && s !== l && this.handler.dispatchToElement(new Bi(l, e), "dragleave", e.event), s && s !== l && this.handler.dispatchToElement(new Bi(s, e), "dragenter", e.event));
}
}, r.prototype._dragEnd = function(e) {
var t = this._draggingTarget;
t && (t.dragging = !1), this.handler.dispatchToElement(new Bi(t, e), "dragend", e.event), this._dropTarget && this.handler.dispatchToElement(new Bi(this._dropTarget, e), "drop", e.event), this._draggingTarget = null, this._dropTarget = null;
}, r;
}(), xr = function() {
function r(e) {
e && (this._$eventProcessor = e);
}
return r.prototype.on = function(e, t, n, a) {
this._$handlers || (this._$handlers = {});
var i = this._$handlers;
if (typeof t == "function" && (a = n, n = t, t = null), !n || !e)
return this;
var o = this._$eventProcessor;
t != null && o && o.normalizeQuery && (t = o.normalizeQuery(t)), i[e] || (i[e] = []);
for (var s = 0; s < i[e].length; s++)
if (i[e][s].h === n)
return this;
var l = {
h: n,
query: t,
ctx: a || this,
callAtLast: n.zrEventfulCallAtLast
}, u = i[e].length - 1, h = i[e][u];
return h && h.callAtLast ? i[e].splice(u, 0, l) : i[e].push(l), this;
}, r.prototype.isSilent = function(e) {
var t = this._$handlers;
return !t || !t[e] || !t[e].length;
}, r.prototype.off = function(e, t) {
var n = this._$handlers;
if (!n)
return this;
if (!e)
return this._$handlers = {}, this;
if (t) {
if (n[e]) {
for (var a = [], i = 0, o = n[e].length; i < o; i++)
n[e][i].h !== t && a.push(n[e][i]);
n[e] = a;
}
n[e] && n[e].length === 0 && delete n[e];
} else
delete n[e];
return this;
}, r.prototype.trigger = function(e) {
for (var t = [], n = 1; n < arguments.length; n++)
t[n - 1] = arguments[n];
if (!this._$handlers)
return this;
var a = this._$handlers[e], i = this._$eventProcessor;
if (a)
for (var o = t.length, s = a.length, l = 0; l < s; l++) {
var u = a[l];
if (!(i && i.filter && u.query != null && !i.filter(e, u.query)))
switch (o) {
case 0:
u.h.call(u.ctx);
break;
case 1:
u.h.call(u.ctx, t[0]);
break;
case 2:
u.h.call(u.ctx, t[0], t[1]);
break;
default:
u.h.apply(u.ctx, t);
break;
}
}
return i && i.afterTrigger && i.afterTrigger(e), this;
}, r.prototype.triggerWithContext = function(e) {
for (var t = [], n = 1; n < arguments.length; n++)
t[n - 1] = arguments[n];
if (!this._$handlers)
return this;
var a = this._$handlers[e], i = this._$eventProcessor;
if (a)
for (var o = t.length, s = t[o - 1], l = a.length, u = 0; u < l; u++) {
var h = a[u];
if (!(i && i.filter && h.query != null && !i.filter(e, h.query)))
switch (o) {
case 0:
h.h.call(s);
break;
case 1:
h.h.call(s, t[0]);
break;
case 2:
h.h.call(s, t[0], t[1]);
break;
default:
h.h.apply(s, t.slice(1, o - 1));
break;
}
}
return i && i.afterTrigger && i.afterTrigger(e), this;
}, r;
}(), VE = Math.log(2);
function td(r, e, t, n, a, i) {
var o = n + "-" + a, s = r.length;
if (i.hasOwnProperty(o))
return i[o];
if (e === 1) {
var l = Math.round(Math.log((1 << s) - 1 & ~a) / VE);
return r[t][l];
}
for (var u = n | 1 << t, h = t + 1; n & 1 << h; )
h++;
for (var f = 0, c = 0, v = 0; c < s; c++) {
var p = 1 << c;
p & a || (f += (v % 2 ? -1 : 1) * r[t][c] * td(r, e - 1, h, u, a | p, i), v++);
}
return i[o] = f, f;
}
function g0(r, e) {
var t = [
[r[0], r[1], 1, 0, 0, 0, -e[0] * r[0], -e[0] * r[1]],
[0, 0, 0, r[0], r[1], 1, -e[1] * r[0], -e[1] * r[1]],
[r[2], r[3], 1, 0, 0, 0, -e[2] * r[2], -e[2] * r[3]],
[0, 0, 0, r[2], r[3], 1, -e[3] * r[2], -e[3] * r[3]],
[r[4], r[5], 1, 0, 0, 0, -e[4] * r[4], -e[4] * r[5]],
[0, 0, 0, r[4], r[5], 1, -e[5] * r[4], -e[5] * r[5]],
[r[6], r[7], 1, 0, 0, 0, -e[6] * r[6], -e[6] * r[7]],
[0, 0, 0, r[6], r[7], 1, -e[7] * r[6], -e[7] * r[7]]
], n = {}, a = td(t, 8, 0, 0, 0, n);
if (a !== 0) {
for (var i = [], o = 0; o < 8; o++)
for (var s = 0; s < 8; s++)
i[s] == null && (i[s] = 0), i[s] += ((o + s) % 2 ? -1 : 1) * td(t, 7, o === 0 ? 1 : 0, 1 << o, 1 << s, n) / a * e[o];
return function(l, u, h) {
var f = u * i[6] + h * i[7] + 1;
l[0] = (u * i[0] + h * i[1] + i[2]) / f, l[1] = (u * i[3] + h * i[4] + i[5]) / f;
};
}
}
var y0 = "___zrEVENTSAVED", Sc = [];
function BE(r, e, t, n, a) {
return ed(Sc, e, n, a, !0) && ed(r, t, Sc[0], Sc[1]);
}
function ed(r, e, t, n, a) {
if (e.getBoundingClientRect && yt.domSupported && !GT(e)) {
var i = e[y0] || (e[y0] = {}), o = zE(e, i), s = GE(o, i, a);
if (s)
return s(r, t, n), !0;
}
return !1;
}
function zE(r, e) {
var t = e.markers;
if (t)
return t;
t = e.markers = [];
for (var n = ["left", "right"], a = ["top", "bottom"], i = 0; i < 4; i++) {
var o = document.createElement("div"), s = o.style, l = i % 2, u = (i >> 1) % 2;
s.cssText = [
"position: absolute",
"visibility: hidden",
"padding: 0",
"margin: 0",
"border-width: 0",
"user-select: none",
"width:0",
"height:0",
n[l] + ":0",
a[u] + ":0",
n[1 - l] + ":auto",
a[1 - u] + ":auto",
""
].join("!important;"), r.appendChild(o), t.push(o);
}
return t;
}
function GE(r, e, t) {
for (var n = t ? "invTrans" : "trans", a = e[n], i = e.srcCoords, o = [], s = [], l = !0, u = 0; u < 4; u++) {
var h = r[u].getBoundingClientRect(), f = 2 * u, c = h.left, v = h.top;
o.push(c, v), l = l && i && c === i[f] && v === i[f + 1], s.push(r[u].offsetLeft, r[u].offsetTop);
}
return l && a ? a : (e.srcCoords = o, e[n] = t ? g0(s, o) : g0(o, s));
}
function GT(r) {
return r.nodeName.toUpperCase() === "CANVAS";
}
var FE = /([&<>"'])/g, HE = {
"&": "&",
"<": "<",
">": ">",
'"': """,
"'": "'"
};
function ke(r) {
return r == null ? "" : (r + "").replace(FE, function(e, t) {
return HE[t];
});
}
var WE = /^(?:mouse|pointer|contextmenu|drag|drop)|click/, xc = [], $E = yt.browser.firefox && +yt.browser.version.split(".")[0] < 39;
function rd(r, e, t, n) {
return t = t || {}, n ? m0(r, e, t) : $E && e.layerX != null && e.layerX !== e.offsetX ? (t.zrX = e.layerX, t.zrY = e.layerY) : e.offsetX != null ? (t.zrX = e.offsetX, t.zrY = e.offsetY) : m0(r, e, t), t;
}
function m0(r, e, t) {
if (yt.domSupported && r.getBoundingClientRect) {
var n = e.clientX, a = e.clientY;
if (GT(r)) {
var i = r.getBoundingClientRect();
t.zrX = n - i.left, t.zrY = a - i.top;
return;
} else if (ed(xc, r, n, a)) {
t.zrX = xc[0], t.zrY = xc[1];
return;
}
}
t.zrX = t.zrY = 0;
}
function ey(r) {
return r || window.event;
}
function ur(r, e, t) {
if (e = ey(e), e.zrX != null)
return e;
var n = e.type, a = n && n.indexOf("touch") >= 0;
if (a) {
var o = n !== "touchend" ? e.targetTouches[0] : e.changedTouches[0];
o && rd(r, o, e, t);
} else {
rd(r, e, e, t);
var i = UE(e);
e.zrDelta = i ? i / 120 : -(e.detail || 0) / 3;
}
var s = e.button;
return e.which == null && s !== void 0 && WE.test(e.type) && (e.which = s & 1 ? 1 : s & 2 ? 3 : s & 4 ? 2 : 0), e;
}
function UE(r) {
var e = r.wheelDelta;
if (e)
return e;
var t = r.deltaX, n = r.deltaY;
if (t == null || n == null)
return e;
var a = Math.abs(n !== 0 ? n : t), i = n > 0 ? -1 : n < 0 ? 1 : t > 0 ? -1 : 1;
return 3 * a * i;
}
function nd(r, e, t, n) {
r.addEventListener(e, t, n);
}
function YE(r, e, t, n) {
r.removeEventListener(e, t, n);
}
var Dn = function(r) {
r.preventDefault(), r.stopPropagation(), r.cancelBubble = !0;
};
function _0(r) {
return r.which === 2 || r.which === 3;
}
var ZE = function() {
function r() {
this._track = [];
}
return r.prototype.recognize = function(e, t, n) {
return this._doTrack(e, t, n), this._recognize(e);
}, r.prototype.clear = function() {
return this._track.length = 0, this;
}, r.prototype._doTrack = function(e, t, n) {
var a = e.touches;
if (a) {
for (var i = {
points: [],
touches: [],
target: t,
event: e
}, o = 0, s = a.length; o < s; o++) {
var l = a[o], u = rd(n, l, {});
i.points.push([u.zrX, u.zrY]), i.touches.push(l);
}
this._track.push(i);
}
}, r.prototype._recognize = function(e) {
for (var t in bc)
if (bc.hasOwnProperty(t)) {
var n = bc[t](this._track, e);
if (n)
return n;
}
}, r;
}();
function S0(r) {
var e = r[1][0] - r[0][0], t = r[1][1] - r[0][1];
return Math.sqrt(e * e + t * t);
}
function XE(r) {
return [
(r[0][0] + r[1][0]) / 2,
(r[0][1] + r[1][1]) / 2
];
}
var bc = {
pinch: function(r, e) {
var t = r.length;
if (t) {
var n = (r[t - 1] || {}).points, a = (r[t - 2] || {}).points || n;
if (a && a.length > 1 && n && n.length > 1) {
var i = S0(n) / S0(a);
!isFinite(i) && (i = 1), e.pinchScale = i;
var o = XE(n);
return e.pinchX = o[0], e.pinchY = o[1], {
type: "pinch",
target: r[0].target,
event: e
};
}
}
}
};
function tr() {
return [1, 0, 0, 1, 0, 0];
}
function kf(r) {
return r[0] = 1, r[1] = 0, r[2] = 0, r[3] = 1, r[4] = 0, r[5] = 0, r;
}
function ry(r, e) {
return r[0] = e[0], r[1] = e[1], r[2] = e[2], r[3] = e[3], r[4] = e[4], r[5] = e[5], r;
}
function xn(r, e, t) {
var n = e[0] * t[0] + e[2] * t[1], a = e[1] * t[0] + e[3] * t[1], i = e[0] * t[2] + e[2] * t[3], o = e[1] * t[2] + e[3] * t[3], s = e[0] * t[4] + e[2] * t[5] + e[4], l = e[1] * t[4] + e[3] * t[5] + e[5];
return r[0] = n, r[1] = a, r[2] = i, r[3] = o, r[4] = s, r[5] = l, r;
}
function nn(r, e, t) {
return r[0] = e[0], r[1] = e[1], r[2] = e[2], r[3] = e[3], r[4] = e[4] + t[0], r[5] = e[5] + t[1], r;
}
function Li(r, e, t, n) {
n === void 0 && (n = [0, 0]);
var a = e[0], i = e[2], o = e[4], s = e[1], l = e[3], u = e[5], h = Math.sin(t), f = Math.cos(t);
return r[0] = a * f + s * h, r[1] = -a * h + s * f, r[2] = i * f + l * h, r[3] = -i * h + f * l, r[4] = f * (o - n[0]) + h * (u - n[1]) + n[0], r[5] = f * (u - n[1]) - h * (o - n[0]) + n[1], r;
}
function ny(r, e, t) {
var n = t[0], a = t[1];
return r[0] = e[0] * n, r[1] = e[1] * a, r[2] = e[2] * n, r[3] = e[3] * a, r[4] = e[4] * n, r[5] = e[5] * a, r;
}
function Vo(r, e) {
var t = e[0], n = e[2], a = e[4], i = e[1], o = e[3], s = e[5], l = t * o - i * n;
return l ? (l = 1 / l, r[0] = o * l, r[1] = -i * l, r[2] = -n * l, r[3] = t * l, r[4] = (n * s - o * a) * l, r[5] = (i * a - t * s) * l, r) : null;
}
function qE(r) {
var e = tr();
return ry(e, r), e;
}
var ft = function() {
function r(e, t) {
this.x = e || 0, this.y = t || 0;
}
return r.prototype.copy = function(e) {
return this.x = e.x, this.y = e.y, this;
}, r.prototype.clone = function() {
return new r(this.x, this.y);
}, r.prototype.set = function(e, t) {
return this.x = e, this.y = t, this;
}, r.prototype.equal = function(e) {
return e.x === this.x && e.y === this.y;
}, r.prototype.add = function(e) {
return this.x += e.x, this.y += e.y, this;
}, r.prototype.scale = function(e) {
this.x *= e, this.y *= e;
}, r.prototype.scaleAndAdd = function(e, t) {
this.x += e.x * t, this.y += e.y * t;
}, r.prototype.sub = function(e) {
return this.x -= e.x, this.y -= e.y, this;
}, r.prototype.dot = function(e) {
return this.x * e.x + this.y * e.y;
}, r.prototype.len = function() {
return Math.sqrt(this.x * this.x + this.y * this.y);
}, r.prototype.lenSquare = function() {
return this.x * this.x + this.y * this.y;
}, r.prototype.normalize = function() {
var e = this.len();
return this.x /= e, this.y /= e, this;
}, r.prototype.distance = function(e) {
var t = this.x - e.x, n = this.y - e.y;
return Math.sqrt(t * t + n * n);
}, r.prototype.distanceSquare = function(e) {
var t = this.x - e.x, n = this.y - e.y;
return t * t + n * n;
}, r.prototype.negate = function() {
return this.x = -this.x, this.y = -this.y, this;
}, r.prototype.transform = function(e) {
if (e) {
var t = this.x, n = this.y;
return this.x = e[0] * t + e[2] * n + e[4], this.y = e[1] * t + e[3] * n + e[5], this;
}
}, r.prototype.toArray = function(e) {
return e[0] = this.x, e[1] = this.y, e;
}, r.prototype.fromArray = function(e) {
this.x = e[0], this.y = e[1];
}, r.set = function(e, t, n) {
e.x = t, e.y = n;
}, r.copy = function(e, t) {
e.x = t.x, e.y = t.y;
}, r.len = function(e) {
return Math.sqrt(e.x * e.x + e.y * e.y);
}, r.lenSquare = function(e) {
return e.x * e.x + e.y * e.y;
}, r.dot = function(e, t) {
return e.x * t.x + e.y * t.y;
}, r.add = function(e, t, n) {
e.x = t.x + n.x, e.y = t.y + n.y;
}, r.sub = function(e, t, n) {
e.x = t.x - n.x, e.y = t.y - n.y;
}, r.scale = function(e, t, n) {
e.x = t.x * n, e.y = t.y * n;
}, r.scaleAndAdd = function(e, t, n, a) {
e.x = t.x + n.x * a, e.y = t.y + n.y * a;
}, r.lerp = function(e, t, n, a) {
var i = 1 - a;
e.x = i * t.x + a * n.x, e.y = i * t.y + a * n.y;
}, r;
}(), nu = Math.min, au = Math.max, xa = new ft(), ba = new ft(), wa = new ft(), Ta = new ft(), es = new ft(), rs = new ft(), ct = function() {
function r(e, t, n, a) {
n < 0 && (e = e + n, n = -n), a < 0 && (t = t + a, a = -a), this.x = e, this.y = t, this.width = n, this.height = a;
}
return r.prototype.union = function(e) {
var t = nu(e.x, this.x), n = nu(e.y, this.y);
isFinite(this.x) && isFinite(this.width) ? this.width = au(e.x + e.width, this.x + this.width) - t : this.width = e.width, isFinite(this.y) && isFinite(this.height) ? this.height = au(e.y + e.height, this.y + this.height) - n : this.height = e.height, this.x = t, this.y = n;
}, r.prototype.applyTransform = function(e) {
r.applyTransform(this, this, e);
}, r.prototype.calculateTransform = function(e) {
var t = this, n = e.width / t.width, a = e.height / t.height, i = tr();
return nn(i, i, [-t.x, -t.y]), ny(i, i, [n, a]), nn(i, i, [e.x, e.y]), i;
}, r.prototype.intersect = function(e, t) {
if (!e)
return !1;
e instanceof r || (e = r.create(e));
var n = this, a = n.x, i = n.x + n.width, o = n.y, s = n.y + n.height, l = e.x, u = e.x + e.width, h = e.y, f = e.y + e.height, c = !(i < l || u < a || s < h || f < o);
if (t) {
var v = 1 / 0, p = 0, d = Math.abs(i - l), g = Math.abs(u - a), y = Math.abs(s - h), m = Math.abs(f - o), _ = Math.min(d, g), S = Math.min(y, m);
i < l || u < a ? _ > p && (p = _, d < g ? ft.set(rs, -d, 0) : ft.set(rs, g, 0)) : _ < v && (v = _, d < g ? ft.set(es, d, 0) : ft.set(es, -g, 0)), s < h || f < o ? S > p && (p = S, y < m ? ft.set(rs, 0, -y) : ft.set(rs, 0, m)) : _ < v && (v = _, y < m ? ft.set(es, 0, y) : ft.set(es, 0, -m));
}
return t && ft.copy(t, c ? es : rs), c;
}, r.prototype.contain = function(e, t) {
var n = this;
return e >= n.x && e <= n.x + n.width && t >= n.y && t <= n.y + n.height;
}, r.prototype.clone = function() {
return new r(this.x, this.y, this.width, this.height);
}, r.prototype.copy = function(e) {
r.copy(this, e);
}, r.prototype.plain = function() {
return {
x: this.x,
y: this.y,
width: this.width,
height: this.height
};
}, r.prototype.isFinite = function() {
return isFinite(this.x) && isFinite(this.y) && isFinite(this.width) && isFinite(this.height);
}, r.prototype.isZero = function() {
return this.width === 0 || this.height === 0;
}, r.create = function(e) {
return new r(e.x, e.y, e.width, e.height);
}, r.copy = function(e, t) {
e.x = t.x, e.y = t.y, e.width = t.width, e.height = t.height;
}, r.applyTransform = function(e, t, n) {
if (!n) {
e !== t && r.copy(e, t);
return;
}
if (n[1] < 1e-5 && n[1] > -1e-5 && n[2] < 1e-5 && n[2] > -1e-5) {
var a = n[0], i = n[3], o = n[4], s = n[5];
e.x = t.x * a + o, e.y = t.y * i + s, e.width = t.width * a, e.height = t.height * i, e.width < 0 && (e.x += e.width, e.width = -e.width), e.height < 0 && (e.y += e.height, e.height = -e.height);
return;
}
xa.x = wa.x = t.x, xa.y = Ta.y = t.y, ba.x = Ta.x = t.x + t.width, ba.y = wa.y = t.y + t.height, xa.transform(n), Ta.transform(n), ba.transform(n), wa.transform(n), e.x = nu(xa.x, ba.x, wa.x, Ta.x), e.y = nu(xa.y, ba.y, wa.y, Ta.y);
var l = au(xa.x, ba.x, wa.x, Ta.x), u = au(xa.y, ba.y, wa.y, Ta.y);
e.width = l - e.x, e.height = u - e.y;
}, r;
}(), FT = "silent";
function KE(r, e, t) {
return {
type: r,
event: t,
target: e.target,
topTarget: e.topTarget,
cancelBubble: !1,
offsetX: t.zrX,
offsetY: t.zrY,
gestureEvent: t.gestureEvent,
pinchX: t.pinchX,
pinchY: t.pinchY,
pinchScale: t.pinchScale,
wheelDelta: t.zrDelta,
zrByTouch: t.zrByTouch,
which: t.which,
stop: jE
};
}
function jE() {
Dn(this.event);
}
var QE = function(r) {
Ht(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t.handler = null, t;
}
return e.prototype.dispose = function() {
}, e.prototype.setCursor = function() {
}, e;
}(xr), ns = /* @__PURE__ */ function() {
function r(e, t) {
this.x = e, this.y = t;
}
return r;
}(), JE = [
"click",
"dblclick",
"mousewheel",
"mouseout",
"mouseup",
"mousedown",
"mousemove",
"contextmenu"
], wc = new ct(0, 0, 0, 0), HT = function(r) {
Ht(e, r);
function e(t, n, a, i, o) {
var s = r.call(this) || this;
return s._hovered = new ns(0, 0), s.storage = t, s.painter = n, s.painterRoot = i, s._pointerSize = o, a = a || new QE(), s.proxy = null, s.setHandlerProxy(a), s._draggingMgr = new OE(s), s;
}
return e.prototype.setHandlerProxy = function(t) {
this.proxy && this.proxy.dispose(), t && (A(JE, function(n) {
t.on && t.on(n, this[n], this);
}, this), t.handler = this), this.proxy = t;
}, e.prototype.mousemove = function(t) {
var n = t.zrX, a = t.zrY, i = WT(this, n, a), o = this._hovered, s = o.target;
s && !s.__zr && (o = this.findHover(o.x, o.y), s = o.target);
var l = this._hovered = i ? new ns(n, a) : this.findHover(n, a), u = l.target, h = this.proxy;
h.setCursor && h.setCursor(u ? u.cursor : "default"), s && u !== s && this.dispatchToElement(o, "mouseout", t), this.dispatchToElement(l, "mousemove", t), u && u !== s && this.dispatchToElement(l, "mouseover", t);
}, e.prototype.mouseout = function(t) {
var n = t.zrEventControl;
n !== "only_globalout" && this.dispatchToElement(this._hovered, "mouseout", t), n !== "no_globalout" && this.trigger("globalout", { type: "globalout", event: t });
}, e.prototype.resize = function() {
this._hovered = new ns(0, 0);
}, e.prototype.dispatch = function(t, n) {
var a = this[t];
a && a.call(this, n);
}, e.prototype.dispose = function() {
this.proxy.dispose(), this.storage = null, this.proxy = null, this.painter = null;
}, e.prototype.setCursorStyle = function(t) {
var n = this.proxy;
n.setCursor && n.setCursor(t);
}, e.prototype.dispatchToElement = function(t, n, a) {
t = t || {};
var i = t.target;
if (!(i && i.silent)) {
for (var o = "on" + n, s = KE(n, t, a); i && (i[o] && (s.cancelBubble = !!i[o].call(i, s)), i.trigger(n, s), i = i.__hostTarget ? i.__hostTarget : i.parent, !s.cancelBubble); )
;
s.cancelBubble || (this.trigger(n, s), this.painter && this.painter.eachOtherLayer && this.painter.eachOtherLayer(function(l) {
typeof l[o] == "function" && l[o].call(l, s), l.trigger && l.trigger(n, s);
}));
}
}, e.prototype.findHover = function(t, n, a) {
var i = this.storage.getDisplayList(), o = new ns(t, n);
if (x0(i, o, t, n, a), this._pointerSize && !o.target) {
for (var s = [], l = this._pointerSize, u = l / 2, h = new ct(t - u, n - u, l, l), f = i.length - 1; f >= 0; f--) {
var c = i[f];
c !== a && !c.ignore && !c.ignoreCoarsePointer && (!c.parent || !c.parent.ignoreCoarsePointer) && (wc.copy(c.getBoundingRect()), c.transform && wc.applyTransform(c.transform), wc.intersect(h) && s.push(c));
}
if (s.length)
for (var v = 4, p = Math.PI / 12, d = Math.PI * 2, g = 0; g < u; g += v)
for (var y = 0; y < d; y += p) {
var m = t + g * Math.cos(y), _ = n + g * Math.sin(y);
if (x0(s, o, m, _, a), o.target)
return o;
}
}
return o;
}, e.prototype.processGesture = function(t, n) {
this._gestureMgr || (this._gestureMgr = new ZE());
var a = this._gestureMgr;
n === "start" && a.clear();
var i = a.recognize(t, this.findHover(t.zrX, t.zrY, null).target, this.proxy.dom);
if (n === "end" && a.clear(), i) {
var o = i.type;
t.gestureEvent = o;
var s = new ns();
s.target = i.target, this.dispatchToElement(s, o, i.event);
}
}, e;
}(xr);
A(["click", "mousedown", "mouseup", "mousewheel", "dblclick", "contextmenu"], function(r) {
HT.prototype[r] = function(e) {
var t = e.zrX, n = e.zrY, a = WT(this, t, n), i, o;
if ((r !== "mouseup" || !a) && (i = this.findHover(t, n), o = i.target), r === "mousedown")
this._downEl = o, this._downPoint = [e.zrX, e.zrY], this._upEl = o;
else if (r === "mouseup")
this._upEl = o;
else if (r === "click") {
if (this._downEl !== this._upEl || !this._downPoint || jn(this._downPoint, [e.zrX, e.zrY]) > 4)
return;
this._downPoint = null;
}
this.dispatchToElement(i, r, e);
};
});
function tP(r, e, t) {
if (r[r.rectHover ? "rectContain" : "contain"](e, t)) {
for (var n = r, a = void 0, i = !1; n; ) {
if (n.ignoreClip && (i = !0), !i) {
var o = n.getClipPath();
if (o && !o.contain(e, t))
return !1;
}
n.silent && (a = !0);
var s = n.__hostTarget;
n = s || n.parent;
}
return a ? FT : !0;
}
return !1;
}
function x0(r, e, t, n, a) {
for (var i = r.length - 1; i >= 0; i--) {
var o = r[i], s = void 0;
if (o !== a && !o.ignore && (s = tP(o, t, n)) && (!e.topTarget && (e.topTarget = o), s !== FT)) {
e.target = o;
break;
}
}
}
function WT(r, e, t) {
var n = r.painter;
return e < 0 || e > n.getWidth() || t < 0 || t > n.getHeight();
}
var $T = 32, as = 7;
function eP(r) {
for (var e = 0; r >= $T; )
e |= r & 1, r >>= 1;
return r + e;
}
function b0(r, e, t, n) {
var a = e + 1;
if (a === t)
return 1;
if (n(r[a++], r[e]) < 0) {
for (; a < t && n(r[a], r[a - 1]) < 0; )
a++;
rP(r, e, a);
} else
for (; a < t && n(r[a], r[a - 1]) >= 0; )
a++;
return a - e;
}
function rP(r, e, t) {
for (t--; e < t; ) {
var n = r[e];
r[e++] = r[t], r[t--] = n;
}
}
function w0(r, e, t, n, a) {
for (n === e && n++; n < t; n++) {
for (var i = r[n], o = e, s = n, l; o < s; )
l = o + s >>> 1, a(i, r[l]) < 0 ? s = l : o = l + 1;
var u = n - o;
switch (u) {
case 3:
r[o + 3] = r[o + 2];
case 2:
r[o + 2] = r[o + 1];
case 1:
r[o + 1] = r[o];
break;
default:
for (; u > 0; )
r[o + u] = r[o + u - 1], u--;
}
r[o] = i;
}
}
function Tc(r, e, t, n, a, i) {
var o = 0, s = 0, l = 1;
if (i(r, e[t + a]) > 0) {
for (s = n - a; l < s && i(r, e[t + a + l]) > 0; )
o = l, l = (l << 1) + 1, l <= 0 && (l = s);
l > s && (l = s), o += a, l += a;
} else {
for (s = a + 1; l < s && i(r, e[t + a - l]) <= 0; )
o = l, l = (l << 1) + 1, l <= 0 && (l = s);
l > s && (l = s);
var u = o;
o = a - l, l = a - u;
}
for (o++; o < l; ) {
var h = o + (l - o >>> 1);
i(r, e[t + h]) > 0 ? o = h + 1 : l = h;
}
return l;
}
function Cc(r, e, t, n, a, i) {
var o = 0, s = 0, l = 1;
if (i(r, e[t + a]) < 0) {
for (s = a + 1; l < s && i(r, e[t + a - l]) < 0; )
o = l, l = (l << 1) + 1, l <= 0 && (l = s);
l > s && (l = s);
var u = o;
o = a - l, l = a - u;
} else {
for (s = n - a; l < s && i(r, e[t + a + l]) >= 0; )
o = l, l = (l << 1) + 1, l <= 0 && (l = s);
l > s && (l = s), o += a, l += a;
}
for (o++; o < l; ) {
var h = o + (l - o >>> 1);
i(r, e[t + h]) < 0 ? l = h : o = h + 1;
}
return l;
}
function nP(r, e) {
var t = as, n, a, i = 0, o = [];
n = [], a = [];
function s(v, p) {
n[i] = v, a[i] = p, i += 1;
}
function l() {
for (; i > 1; ) {
var v = i - 2;
if (v >= 1 && a[v - 1] <= a[v] + a[v + 1] || v >= 2 && a[v - 2] <= a[v] + a[v - 1])
a[v - 1] < a[v + 1] && v--;
else if (a[v] > a[v + 1])
break;
h(v);
}
}
function u() {
for (; i > 1; ) {
var v = i - 2;
v > 0 && a[v - 1] < a[v + 1] && v--, h(v);
}
}
function h(v) {
var p = n[v], d = a[v], g = n[v + 1], y = a[v + 1];
a[v] = d + y, v === i - 3 && (n[v + 1] = n[v + 2], a[v + 1] = a[v + 2]), i--;
var m = Cc(r[g], r, p, d, 0, e);
p += m, d -= m, d !== 0 && (y = Tc(r[p + d - 1], r, g, y, y - 1, e), y !== 0 && (d <= y ? f(p, d, g, y) : c(p, d, g, y)));
}
function f(v, p, d, g) {
var y = 0;
for (y = 0; y < p; y++)
o[y] = r[v + y];
var m = 0, _ = d, S = v;
if (r[S++] = r[_++], --g === 0) {
for (y = 0; y < p; y++)
r[S + y] = o[m + y];
return;
}
if (p === 1) {
for (y = 0; y < g; y++)
r[S + y] = r[_ + y];
r[S + g] = o[m];
return;
}
for (var x = t, b, w, T; ; ) {
b = 0, w = 0, T = !1;
do
if (e(r[_], o[m]) < 0) {
if (r[S++] = r[_++], w++, b = 0, --g === 0) {
T = !0;
break;
}
} else if (r[S++] = o[m++], b++, w = 0, --p === 1) {
T = !0;
break;
}
while ((b | w) < x);
if (T)
break;
do {
if (b = Cc(r[_], o, m, p, 0, e), b !== 0) {
for (y = 0; y < b; y++)
r[S + y] = o[m + y];
if (S += b, m += b, p -= b, p <= 1) {
T = !0;
break;
}
}
if (r[S++] = r[_++], --g === 0) {
T = !0;
break;
}
if (w = Tc(o[m], r, _, g, 0, e), w !== 0) {
for (y = 0; y < w; y++)
r[S + y] = r[_ + y];
if (S += w, _ += w, g -= w, g === 0) {
T = !0;
break;
}
}
if (r[S++] = o[m++], --p === 1) {
T = !0;
break;
}
x--;
} while (b >= as || w >= as);
if (T)
break;
x < 0 && (x = 0), x += 2;
}
if (t = x, t < 1 && (t = 1), p === 1) {
for (y = 0; y < g; y++)
r[S + y] = r[_ + y];
r[S + g] = o[m];
} else {
if (p === 0)
throw new Error();
for (y = 0; y < p; y++)
r[S + y] = o[m + y];
}
}
function c(v, p, d, g) {
var y = 0;
for (y = 0; y < g; y++)
o[y] = r[d + y];
var m = v + p - 1, _ = g - 1, S = d + g - 1, x = 0, b = 0;
if (r[S--] = r[m--], --p === 0) {
for (x = S - (g - 1), y = 0; y < g; y++)
r[x + y] = o[y];
return;
}
if (g === 1) {
for (S -= p, m -= p, b = S + 1, x = m + 1, y = p - 1; y >= 0; y--)
r[b + y] = r[x + y];
r[S] = o[_];
return;
}
for (var w = t; ; ) {
var T = 0, C = 0, D = !1;
do
if (e(o[_], r[m]) < 0) {
if (r[S--] = r[m--], T++, C = 0, --p === 0) {
D = !0;
break;
}
} else if (r[S--] = o[_--], C++, T = 0, --g === 1) {
D = !0;
break;
}
while ((T | C) < w);
if (D)
break;
do {
if (T = p - Cc(o[_], r, v, p, p - 1, e), T !== 0) {
for (S -= T, m -= T, p -= T, b = S + 1, x = m + 1, y = T - 1; y >= 0; y--)
r[b + y] = r[x + y];
if (p === 0) {
D = !0;
break;
}
}
if (r[S--] = o[_--], --g === 1) {
D = !0;
break;
}
if (C = g - Tc(r[m], o, 0, g, g - 1, e), C !== 0) {
for (S -= C, _ -= C, g -= C, b = S + 1, x = _ + 1, y = 0; y < C; y++)
r[b + y] = o[x + y];
if (g <= 1) {
D = !0;
break;
}
}
if (r[S--] = r[m--], --p === 0) {
D = !0;
break;
}
w--;
} while (T >= as || C >= as);
if (D)
break;
w < 0 && (w = 0), w += 2;
}
if (t = w, t < 1 && (t = 1), g === 1) {
for (S -= p, m -= p, b = S + 1, x = m + 1, y = p - 1; y >= 0; y--)
r[b + y] = r[x + y];
r[S] = o[_];
} else {
if (g === 0)
throw new Error();
for (x = S - (g - 1), y = 0; y < g; y++)
r[x + y] = o[y];
}
}
return {
mergeRuns: l,
forceMergeRuns: u,
pushRun: s
};
}
function sh(r, e, t, n) {
t || (t = 0), n || (n = r.length);
var a = n - t;
if (!(a < 2)) {
var i = 0;
if (a < $T) {
i = b0(r, t, n, e), w0(r, t, n, t + i, e);
return;
}
var o = nP(r, e), s = eP(a);
do {
if (i = b0(r, t, n, e), i < s) {
var l = a;
l > s && (l = s), w0(r, t, t + l, t + i, e), i = l;
}
o.pushRun(t, i), o.mergeRuns(), a -= i, t += i;
} while (a !== 0);
o.forceMergeRuns();
}
}
var tn = 1, lh = 2, Ls = 4, T0 = !1;
function Dc() {
T0 || (T0 = !0, console.warn("z / z2 / zlevel of displayable is invalid, which may cause unexpected errors"));
}
function C0(r, e) {
return r.zlevel === e.zlevel ? r.z === e.z ? r.z2 - e.z2 : r.z - e.z : r.zlevel - e.zlevel;
}
var aP = function() {
function r() {
this._roots = [], this._displayList = [], this._displayListLen = 0, this.displayableSortFunc = C0;
}
return r.prototype.traverse = function(e, t) {
for (var n = 0; n < this._roots.length; n++)
this._roots[n].traverse(e, t);
}, r.prototype.getDisplayList = function(e, t) {
t = t || !1;
var n = this._displayList;
return (e || !n.length) && this.updateDisplayList(t), n;
}, r.prototype.updateDisplayList = function(e) {
this._displayListLen = 0;
for (var t = this._roots, n = this._displayList, a = 0, i = t.length; a < i; a++)
this._updateAndAddDisplayable(t[a], null, e);
n.length = this._displayListLen, sh(n, C0);
}, r.prototype._updateAndAddDisplayable = function(e, t, n) {
if (!(e.ignore && !n)) {
e.beforeUpdate(), e.update(), e.afterUpdate();
var a = e.getClipPath();
if (e.ignoreClip)
t = null;
else if (a) {
t ? t = t.slice() : t = [];
for (var i = a, o = e; i; )
i.parent = o, i.updateTransform(), t.push(i), o = i, i = i.getClipPath();
}
if (e.childrenRef) {
for (var s = e.childrenRef(), l = 0; l < s.length; l++) {
var u = s[l];
e.__dirty && (u.__dirty |= tn), this._updateAndAddDisplayable(u, t, n);
}
e.__dirty = 0;
} else {
var h = e;
t && t.length ? h.__clipPaths = t : h.__clipPaths && h.__clipPaths.length > 0 && (h.__clipPaths = []), isNaN(h.z) && (Dc(), h.z = 0), isNaN(h.z2) && (Dc(), h.z2 = 0), isNaN(h.zlevel) && (Dc(), h.zlevel = 0), this._displayList[this._displayListLen++] = h;
}
var f = e.getDecalElement && e.getDecalElement();
f && this._updateAndAddDisplayable(f, t, n);
var c = e.getTextGuideLine();
c && this._updateAndAddDisplayable(c, t, n);
var v = e.getTextContent();
v && this._updateAndAddDisplayable(v, t, n);
}
}, r.prototype.addRoot = function(e) {
e.__zr && e.__zr.storage === this || this._roots.push(e);
}, r.prototype.delRoot = function(e) {
if (e instanceof Array) {
for (var t = 0, n = e.length; t < n; t++)
this.delRoot(e[t]);
return;
}
var a = pt(this._roots, e);
a >= 0 && this._roots.splice(a, 1);
}, r.prototype.delAllRoots = function() {
this._roots = [], this._displayList = [], this._displayListLen = 0;
}, r.prototype.getRoots = function() {
return this._roots;
}, r.prototype.dispose = function() {
this._displayList = null, this._roots = null;
}, r;
}(), Lh;
Lh = yt.hasGlobalWindow && (window.requestAnimationFrame && window.requestAnimationFrame.bind(window) || window.msRequestAnimationFrame && window.msRequestAnimationFrame.bind(window) || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame) || function(r) {
return setTimeout(r, 16);
};
var Us = {
linear: function(r) {
return r;
},
quadraticIn: function(r) {
return r * r;
},
quadraticOut: function(r) {
return r * (2 - r);
},
quadraticInOut: function(r) {
return (r *= 2) < 1 ? 0.5 * r * r : -0.5 * (--r * (r - 2) - 1);
},
cubicIn: function(r) {
return r * r * r;
},
cubicOut: function(r) {
return --r * r * r + 1;
},
cubicInOut: function(r) {
return (r *= 2) < 1 ? 0.5 * r * r * r : 0.5 * ((r -= 2) * r * r + 2);
},
quarticIn: function(r) {
return r * r * r * r;
},
quarticOut: function(r) {
return 1 - --r * r * r * r;
},
quarticInOut: function(r) {
return (r *= 2) < 1 ? 0.5 * r * r * r * r : -0.5 * ((r -= 2) * r * r * r - 2);
},
quinticIn: function(r) {
return r * r * r * r * r;
},
quinticOut: function(r) {
return --r * r * r * r * r + 1;
},
quinticInOut: function(r) {
return (r *= 2) < 1 ? 0.5 * r * r * r * r * r : 0.5 * ((r -= 2) * r * r * r * r + 2);
},
sinusoidalIn: function(r) {
return 1 - Math.cos(r * Math.PI / 2);
},
sinusoidalOut: function(r) {
return Math.sin(r * Math.PI / 2);
},
sinusoidalInOut: function(r) {
return 0.5 * (1 - Math.cos(Math.PI * r));
},
exponentialIn: function(r) {
return r === 0 ? 0 : Math.pow(1024, r - 1);
},
exponentialOut: function(r) {
return r === 1 ? 1 : 1 - Math.pow(2, -10 * r);
},
exponentialInOut: function(r) {
return r === 0 ? 0 : r === 1 ? 1 : (r *= 2) < 1 ? 0.5 * Math.pow(1024, r - 1) : 0.5 * (-Math.pow(2, -10 * (r - 1)) + 2);
},
circularIn: function(r) {
return 1 - Math.sqrt(1 - r * r);
},
circularOut: function(r) {
return Math.sqrt(1 - --r * r);
},
circularInOut: function(r) {
return (r *= 2) < 1 ? -0.5 * (Math.sqrt(1 - r * r) - 1) : 0.5 * (Math.sqrt(1 - (r -= 2) * r) + 1);
},
elasticIn: function(r) {
var e, t = 0.1, n = 0.4;
return r === 0 ? 0 : r === 1 ? 1 : (!t || t < 1 ? (t = 1, e = n / 4) : e = n * Math.asin(1 / t) / (2 * Math.PI), -(t * Math.pow(2, 10 * (r -= 1)) * Math.sin((r - e) * (2 * Math.PI) / n)));
},
elasticOut: function(r) {
var e, t = 0.1, n = 0.4;
return r === 0 ? 0 : r === 1 ? 1 : (!t || t < 1 ? (t = 1, e = n / 4) : e = n * Math.asin(1 / t) / (2 * Math.PI), t * Math.pow(2, -10 * r) * Math.sin((r - e) * (2 * Math.PI) / n) + 1);
},
elasticInOut: function(r) {
var e, t = 0.1, n = 0.4;
return r === 0 ? 0 : r === 1 ? 1 : (!t || t < 1 ? (t = 1, e = n / 4) : e = n * Math.asin(1 / t) / (2 * Math.PI), (r *= 2) < 1 ? -0.5 * (t * Math.pow(2, 10 * (r -= 1)) * Math.sin((r - e) * (2 * Math.PI) / n)) : t * Math.pow(2, -10 * (r -= 1)) * Math.sin((r - e) * (2 * Math.PI) / n) * 0.5 + 1);
},
backIn: function(r) {
var e = 1.70158;
return r * r * ((e + 1) * r - e);
},
backOut: function(r) {
var e = 1.70158;
return --r * r * ((e + 1) * r + e) + 1;
},
backInOut: function(r) {
var e = 2.5949095;
return (r *= 2) < 1 ? 0.5 * (r * r * ((e + 1) * r - e)) : 0.5 * ((r -= 2) * r * ((e + 1) * r + e) + 2);
},
bounceIn: function(r) {
return 1 - Us.bounceOut(1 - r);
},
bounceOut: function(r) {
return r < 1 / 2.75 ? 7.5625 * r * r : r < 2 / 2.75 ? 7.5625 * (r -= 1.5 / 2.75) * r + 0.75 : r < 2.5 / 2.75 ? 7.5625 * (r -= 2.25 / 2.75) * r + 0.9375 : 7.5625 * (r -= 2.625 / 2.75) * r + 0.984375;
},
bounceInOut: function(r) {
return r < 0.5 ? Us.bounceIn(r * 2) * 0.5 : Us.bounceOut(r * 2 - 1) * 0.5 + 0.5;
}
}, iu = Math.pow, oa = Math.sqrt, UT = 1e-8, YT = 1e-4, D0 = oa(3), ou = 1 / 3, Xr = Ii(), vr = Ii(), mo = Ii();
function ta(r) {
return r > -1e-8 && r < UT;
}
function ZT(r) {
return r > UT || r < -1e-8;
}
function ue(r, e, t, n, a) {
var i = 1 - a;
return i * i * (i * r + 3 * a * e) + a * a * (a * n + 3 * i * t);
}
function A0(r, e, t, n, a) {
var i = 1 - a;
return 3 * (((e - r) * i + 2 * (t - e) * a) * i + (n - t) * a * a);
}
function Eh(r, e, t, n, a, i) {
var o = n + 3 * (e - t) - r, s = 3 * (t - e * 2 + r), l = 3 * (e - r), u = r - a, h = s * s - 3 * o * l, f = s * l - 9 * o * u, c = l * l - 3 * s * u, v = 0;
if (ta(h) && ta(f))
if (ta(s))
i[0] = 0;
else {
var p = -l / s;
p >= 0 && p <= 1 && (i[v++] = p);
}
else {
var d = f * f - 4 * h * c;
if (ta(d)) {
var g = f / h, p = -s / o + g, y = -g / 2;
p >= 0 && p <= 1 && (i[v++] = p), y >= 0 && y <= 1 && (i[v++] = y);
} else if (d > 0) {
var m = oa(d), _ = h * s + 1.5 * o * (-f + m), S = h * s + 1.5 * o * (-f - m);
_ < 0 ? _ = -iu(-_, ou) : _ = iu(_, ou), S < 0 ? S = -iu(-S, ou) : S = iu(S, ou);
var p = (-s - (_ + S)) / (3 * o);
p >= 0 && p <= 1 && (i[v++] = p);
} else {
var x = (2 * h * s - 3 * o * f) / (2 * oa(h * h * h)), b = Math.acos(x) / 3, w = oa(h), T = Math.cos(b), p = (-s - 2 * w * T) / (3 * o), y = (-s + w * (T + D0 * Math.sin(b))) / (3 * o), C = (-s + w * (T - D0 * Math.sin(b))) / (3 * o);
p >= 0 && p <= 1 && (i[v++] = p), y >= 0 && y <= 1 && (i[v++] = y), C >= 0 && C <= 1 && (i[v++] = C);
}
}
return v;
}
function XT(r, e, t, n, a) {
var i = 6 * t - 12 * e + 6 * r, o = 9 * e + 3 * n - 3 * r - 9 * t, s = 3 * e - 3 * r, l = 0;
if (ta(o)) {
if (ZT(i)) {
var u = -s / i;
u >= 0 && u <= 1 && (a[l++] = u);
}
} else {
var h = i * i - 4 * o * s;
if (ta(h))
a[0] = -i / (2 * o);
else if (h > 0) {
var f = oa(h), u = (-i + f) / (2 * o), c = (-i - f) / (2 * o);
u >= 0 && u <= 1 && (a[l++] = u), c >= 0 && c <= 1 && (a[l++] = c);
}
}
return l;
}
function fa(r, e, t, n, a, i) {
var o = (e - r) * a + r, s = (t - e) * a + e, l = (n - t) * a + t, u = (s - o) * a + o, h = (l - s) * a + s, f = (h - u) * a + u;
i[0] = r, i[1] = o, i[2] = u, i[3] = f, i[4] = f, i[5] = h, i[6] = l, i[7] = n;
}
function qT(r, e, t, n, a, i, o, s, l, u, h) {
var f, c = 5e-3, v = 1 / 0, p, d, g, y;
Xr[0] = l, Xr[1] = u;
for (var m = 0; m < 1; m += 0.05)
vr[0] = ue(r, t, a, o, m), vr[1] = ue(e, n, i, s, m), g = ui(Xr, vr), g < v && (f = m, v = g);
v = 1 / 0;
for (var _ = 0; _ < 32 && !(c < YT); _++)
p = f - c, d = f + c, vr[0] = ue(r, t, a, o, p), vr[1] = ue(e, n, i, s, p), g = ui(vr, Xr), p >= 0 && g < v ? (f = p, v = g) : (mo[0] = ue(r, t, a, o, d), mo[1] = ue(e, n, i, s, d), y = ui(mo, Xr), d <= 1 && y < v ? (f = d, v = y) : c *= 0.5);
return h && (h[0] = ue(r, t, a, o, f), h[1] = ue(e, n, i, s, f)), oa(v);
}
function iP(r, e, t, n, a, i, o, s, l) {
for (var u = r, h = e, f = 0, c = 1 / l, v = 1; v <= l; v++) {
var p = v * c, d = ue(r, t, a, o, p), g = ue(e, n, i, s, p), y = d - u, m = g - h;
f += Math.sqrt(y * y + m * m), u = d, h = g;
}
return f;
}
function de(r, e, t, n) {
var a = 1 - n;
return a * (a * r + 2 * n * e) + n * n * t;
}
function ad(r, e, t, n) {
return 2 * ((1 - n) * (e - r) + n * (t - e));
}
function oP(r, e, t, n, a) {
var i = r - 2 * e + t, o = 2 * (e - r), s = r - n, l = 0;
if (ta(i)) {
if (ZT(o)) {
var u = -s / o;
u >= 0 && u <= 1 && (a[l++] = u);
}
} else {
var h = o * o - 4 * i * s;
if (ta(h)) {
var u = -o / (2 * i);
u >= 0 && u <= 1 && (a[l++] = u);
} else if (h > 0) {
var f = oa(h), u = (-o + f) / (2 * i), c = (-o - f) / (2 * i);
u >= 0 && u <= 1 && (a[l++] = u), c >= 0 && c <= 1 && (a[l++] = c);
}
}
return l;
}
function KT(r, e, t) {
var n = r + t - 2 * e;
return n === 0 ? 0.5 : (r - e) / n;
}
function sl(r, e, t, n, a) {
var i = (e - r) * n + r, o = (t - e) * n + e, s = (o - i) * n + i;
a[0] = r, a[1] = i, a[2] = s, a[3] = s, a[4] = o, a[5] = t;
}
function jT(r, e, t, n, a, i, o, s, l) {
var u, h = 5e-3, f = 1 / 0;
Xr[0] = o, Xr[1] = s;
for (var c = 0; c < 1; c += 0.05) {
vr[0] = de(r, t, a, c), vr[1] = de(e, n, i, c);
var v = ui(Xr, vr);
v < f && (u = c, f = v);
}
f = 1 / 0;
for (var p = 0; p < 32 && !(h < YT); p++) {
var d = u - h, g = u + h;
vr[0] = de(r, t, a, d), vr[1] = de(e, n, i, d);
var v = ui(vr, Xr);
if (d >= 0 && v < f)
u = d, f = v;
else {
mo[0] = de(r, t, a, g), mo[1] = de(e, n, i, g);
var y = ui(mo, Xr);
g <= 1 && y < f ? (u = g, f = y) : h *= 0.5;
}
}
return l && (l[0] = de(r, t, a, u), l[1] = de(e, n, i, u)), oa(f);
}
function sP(r, e, t, n, a, i, o) {
for (var s = r, l = e, u = 0, h = 1 / o, f = 1; f <= o; f++) {
var c = f * h, v = de(r, t, a, c), p = de(e, n, i, c), d = v - s, g = p - l;
u += Math.sqrt(d * d + g * g), s = v, l = p;
}
return u;
}
var lP = /cubic-bezier\(([0-9,\.e ]+)\)/;
function ay(r) {
var e = r && lP.exec(r);
if (e) {
var t = e[1].split(","), n = +Ir(t[0]), a = +Ir(t[1]), i = +Ir(t[2]), o = +Ir(t[3]);
if (isNaN(n + a + i + o))
return;
var s = [];
return function(l) {
return l <= 0 ? 0 : l >= 1 ? 1 : Eh(0, n, i, 1, l, s) && ue(0, a, o, 1, s[0]);
};
}
}
var uP = function() {
function r(e) {
this._inited = !1, this._startTime = 0, this._pausedTime = 0, this._paused = !1, this._life = e.life || 1e3, this._delay = e.delay || 0, this.loop = e.loop || !1, this.onframe = e.onframe || Jt, this.ondestroy = e.ondestroy || Jt, this.onrestart = e.onrestart || Jt, e.easing && this.setEasing(e.easing);
}
return r.prototype.step = function(e, t) {
if (this._inited || (this._startTime = e + this._delay, this._inited = !0), this._paused) {
this._pausedTime += t;
return;
}
var n = this._life, a = e - this._startTime - this._pausedTime, i = a / n;
i < 0 && (i = 0), i = Math.min(i, 1);
var o = this.easingFunc, s = o ? o(i) : i;
if (this.onframe(s), i === 1)
if (this.loop) {
var l = a % n;
this._startTime = e - l, this._pausedTime = 0, this.onrestart();
} else
return !0;
return !1;
}, r.prototype.pause = function() {
this._paused = !0;
}, r.prototype.resume = function() {
this._paused = !1;
}, r.prototype.setEasing = function(e) {
this.easing = e, this.easingFunc = K(e) ? e : Us[e] || ay(e);
}, r;
}(), QT = /* @__PURE__ */ function() {
function r(e) {
this.value = e;
}
return r;
}(), hP = function() {
function r() {
this._len = 0;
}
return r.prototype.insert = function(e) {
var t = new QT(e);
return this.insertEntry(t), t;
}, r.prototype.insertEntry = function(e) {
this.head ? (this.tail.next = e, e.prev = this.tail, e.next = null, this.tail = e) : this.head = this.tail = e, this._len++;
}, r.prototype.remove = function(e) {
var t = e.prev, n = e.next;
t ? t.next = n : this.head = n, n ? n.prev = t : this.tail = t, e.next = e.prev = null, this._len--;
}, r.prototype.len = function() {
return this._len;
}, r.prototype.clear = function() {
this.head = this.tail = null, this._len = 0;
}, r;
}(), Rl = function() {
function r(e) {
this._list = new hP(), this._maxSize = 10, this._map = {}, this._maxSize = e;
}
return r.prototype.put = function(e, t) {
var n = this._list, a = this._map, i = null;
if (a[e] == null) {
var o = n.len(), s = this._lastRemovedEntry;
if (o >= this._maxSize && o > 0) {
var l = n.head;
n.remove(l), delete a[l.key], i = l.value, this._lastRemovedEntry = l;
}
s ? s.value = t : s = new QT(t), s.key = e, n.insertEntry(s), a[e] = s;
}
return i;
}, r.prototype.get = function(e) {
var t = this._map[e], n = this._list;
if (t != null)
return t !== n.tail && (n.remove(t), n.insertEntry(t)), t.value;
}, r.prototype.clear = function() {
this._list.clear(), this._map = {};
}, r.prototype.len = function() {
return this._list.len();
}, r;
}(), M0 = {
transparent: [0, 0, 0, 0],
aliceblue: [240, 248, 255, 1],
antiquewhite: [250, 235, 215, 1],
aqua: [0, 255, 255, 1],
aquamarine: [127, 255, 212, 1],
azure: [240, 255, 255, 1],
beige: [245, 245, 220, 1],
bisque: [255, 228, 196, 1],
black: [0, 0, 0, 1],
blanchedalmond: [255, 235, 205, 1],
blue: [0, 0, 255, 1],
blueviolet: [138, 43, 226, 1],
brown: [165, 42, 42, 1],
burlywood: [222, 184, 135, 1],
cadetblue: [95, 158, 160, 1],
chartreuse: [127, 255, 0, 1],
chocolate: [210, 105, 30, 1],
coral: [255, 127, 80, 1],
cornflowerblue: [100, 149, 237, 1],
cornsilk: [255, 248, 220, 1],
crimson: [220, 20, 60, 1],
cyan: [0, 255, 255, 1],
darkblue: [0, 0, 139, 1],
darkcyan: [0, 139, 139, 1],
darkgoldenrod: [184, 134, 11, 1],
darkgray: [169, 169, 169, 1],
darkgreen: [0, 100, 0, 1],
darkgrey: [169, 169, 169, 1],
darkkhaki: [189, 183, 107, 1],
darkmagenta: [139, 0, 139, 1],
darkolivegreen: [85, 107, 47, 1],
darkorange: [255, 140, 0, 1],
darkorchid: [153, 50, 204, 1],
darkred: [139, 0, 0, 1],
darksalmon: [233, 150, 122, 1],
darkseagreen: [143, 188, 143, 1],
darkslateblue: [72, 61, 139, 1],
darkslategray: [47, 79, 79, 1],
darkslategrey: [47, 79, 79, 1],
darkturquoise: [0, 206, 209, 1],
darkviolet: [148, 0, 211, 1],
deeppink: [255, 20, 147, 1],
deepskyblue: [0, 191, 255, 1],
dimgray: [105, 105, 105, 1],
dimgrey: [105, 105, 105, 1],
dodgerblue: [30, 144, 255, 1],
firebrick: [178, 34, 34, 1],
floralwhite: [255, 250, 240, 1],
forestgreen: [34, 139, 34, 1],
fuchsia: [255, 0, 255, 1],
gainsboro: [220, 220, 220, 1],
ghostwhite: [248, 248, 255, 1],
gold: [255, 215, 0, 1],
goldenrod: [218, 165, 32, 1],
gray: [128, 128, 128, 1],
green: [0, 128, 0, 1],
greenyellow: [173, 255, 47, 1],
grey: [128, 128, 128, 1],
honeydew: [240, 255, 240, 1],
hotpink: [255, 105, 180, 1],
indianred: [205, 92, 92, 1],
indigo: [75, 0, 130, 1],
ivory: [255, 255, 240, 1],
khaki: [240, 230, 140, 1],
lavender: [230, 230, 250, 1],
lavenderblush: [255, 240, 245, 1],
lawngreen: [124, 252, 0, 1],
lemonchiffon: [255, 250, 205, 1],
lightblue: [173, 216, 230, 1],
lightcoral: [240, 128, 128, 1],
lightcyan: [224, 255, 255, 1],
lightgoldenrodyellow: [250, 250, 210, 1],
lightgray: [211, 211, 211, 1],
lightgreen: [144, 238, 144, 1],
lightgrey: [211, 211, 211, 1],
lightpink: [255, 182, 193, 1],
lightsalmon: [255, 160, 122, 1],
lightseagreen: [32, 178, 170, 1],
lightskyblue: [135, 206, 250, 1],
lightslategray: [119, 136, 153, 1],
lightslategrey: [119, 136, 153, 1],
lightsteelblue: [176, 196, 222, 1],
lightyellow: [255, 255, 224, 1],
lime: [0, 255, 0, 1],
limegreen: [50, 205, 50, 1],
linen: [250, 240, 230, 1],
magenta: [255, 0, 255, 1],
maroon: [128, 0, 0, 1],
mediumaquamarine: [102, 205, 170, 1],
mediumblue: [0, 0, 205, 1],
mediumorchid: [186, 85, 211, 1],
mediumpurple: [147, 112, 219, 1],
mediumseagreen: [60, 179, 113, 1],
mediumslateblue: [123, 104, 238, 1],
mediumspringgreen: [0, 250, 154, 1],
mediumturquoise: [72, 209, 204, 1],
mediumvioletred: [199, 21, 133, 1],
midnightblue: [25, 25, 112, 1],
mintcream: [245, 255, 250, 1],
mistyrose: [255, 228, 225, 1],
moccasin: [255, 228, 181, 1],
navajowhite: [255, 222, 173, 1],
navy: [0, 0, 128, 1],
oldlace: [253, 245, 230, 1],
olive: [128, 128, 0, 1],
olivedrab: [107, 142, 35, 1],
orange: [255, 165, 0, 1],
orangered: [255, 69, 0, 1],
orchid: [218, 112, 214, 1],
palegoldenrod: [238, 232, 170, 1],
palegreen: [152, 251, 152, 1],
paleturquoise: [175, 238, 238, 1],
palevioletred: [219, 112, 147, 1],
papayawhip: [255, 239, 213, 1],
peachpuff: [255, 218, 185, 1],
peru: [205, 133, 63, 1],
pink: [255, 192, 203, 1],
plum: [221, 160, 221, 1],
powderblue: [176, 224, 230, 1],
purple: [128, 0, 128, 1],
red: [255, 0, 0, 1],
rosybrown: [188, 143, 143, 1],
royalblue: [65, 105, 225, 1],
saddlebrown: [139, 69, 19, 1],
salmon: [250, 128, 114, 1],
sandybrown: [244, 164, 96, 1],
seagreen: [46, 139, 87, 1],
seashell: [255, 245, 238, 1],
sienna: [160, 82, 45, 1],
silver: [192, 192, 192, 1],
skyblue: [135, 206, 235, 1],
slateblue: [106, 90, 205, 1],
slategray: [112, 128, 144, 1],
slategrey: [112, 128, 144, 1],
snow: [255, 250, 250, 1],
springgreen: [0, 255, 127, 1],
steelblue: [70, 130, 180, 1],
tan: [210, 180, 140, 1],
teal: [0, 128, 128, 1],
thistle: [216, 191, 216, 1],
tomato: [255, 99, 71, 1],
turquoise: [64, 224, 208, 1],
violet: [238, 130, 238, 1],
wheat: [245, 222, 179, 1],
white: [255, 255, 255, 1],
whitesmoke: [245, 245, 245, 1],
yellow: [255, 255, 0, 1],
yellowgreen: [154, 205, 50, 1]
};
function Pr(r) {
return r = Math.round(r), r < 0 ? 0 : r > 255 ? 255 : r;
}
function fP(r) {
return r = Math.round(r), r < 0 ? 0 : r > 360 ? 360 : r;
}
function ll(r) {
return r < 0 ? 0 : r > 1 ? 1 : r;
}
function Ac(r) {
var e = r;
return e.length && e.charAt(e.length - 1) === "%" ? Pr(parseFloat(e) / 100 * 255) : Pr(parseInt(e, 10));
}
function hi(r) {
var e = r;
return e.length && e.charAt(e.length - 1) === "%" ? ll(parseFloat(e) / 100) : ll(parseFloat(e));
}
function Mc(r, e, t) {
return t < 0 ? t += 1 : t > 1 && (t -= 1), t * 6 < 1 ? r + (e - r) * t * 6 : t * 2 < 1 ? e : t * 3 < 2 ? r + (e - r) * (2 / 3 - t) * 6 : r;
}
function ea(r, e, t) {
return r + (e - r) * t;
}
function lr(r, e, t, n, a) {
return r[0] = e, r[1] = t, r[2] = n, r[3] = a, r;
}
function id(r, e) {
return r[0] = e[0], r[1] = e[1], r[2] = e[2], r[3] = e[3], r;
}
var JT = new Rl(20), su = null;
function zi(r, e) {
su && id(su, e), su = JT.put(r, su || e.slice());
}
function er(r, e) {
if (r) {
e = e || [];
var t = JT.get(r);
if (t)
return id(e, t);
r = r + "";
var n = r.replace(/ /g, "").toLowerCase();
if (n in M0)
return id(e, M0[n]), zi(r, e), e;
var a = n.length;
if (n.charAt(0) === "#") {
if (a === 4 || a === 5) {
var i = parseInt(n.slice(1, 4), 16);
if (!(i >= 0 && i <= 4095)) {
lr(e, 0, 0, 0, 1);
return;
}
return lr(e, (i & 3840) >> 4 | (i & 3840) >> 8, i & 240 | (i & 240) >> 4, i & 15 | (i & 15) << 4, a === 5 ? parseInt(n.slice(4), 16) / 15 : 1), zi(r, e), e;
} else if (a === 7 || a === 9) {
var i = parseInt(n.slice(1, 7), 16);
if (!(i >= 0 && i <= 16777215)) {
lr(e, 0, 0, 0, 1);
return;
}
return lr(e, (i & 16711680) >> 16, (i & 65280) >> 8, i & 255, a === 9 ? parseInt(n.slice(7), 16) / 255 : 1), zi(r, e), e;
}
return;
}
var o = n.indexOf("("), s = n.indexOf(")");
if (o !== -1 && s + 1 === a) {
var l = n.substr(0, o), u = n.substr(o + 1, s - (o + 1)).split(","), h = 1;
switch (l) {
case "rgba":
if (u.length !== 4)
return u.length === 3 ? lr(e, +u[0], +u[1], +u[2], 1) : lr(e, 0, 0, 0, 1);
h = hi(u.pop());
case "rgb":
if (u.length >= 3)
return lr(e, Ac(u[0]), Ac(u[1]), Ac(u[2]), u.length === 3 ? h : hi(u[3])), zi(r, e), e;
lr(e, 0, 0, 0, 1);
return;
case "hsla":
if (u.length !== 4) {
lr(e, 0, 0, 0, 1);
return;
}
return u[3] = hi(u[3]), od(u, e), zi(r, e), e;
case "hsl":
if (u.length !== 3) {
lr(e, 0, 0, 0, 1);
return;
}
return od(u, e), zi(r, e), e;
default:
return;
}
}
lr(e, 0, 0, 0, 1);
}
}
function od(r, e) {
var t = (parseFloat(r[0]) % 360 + 360) % 360 / 360, n = hi(r[1]), a = hi(r[2]), i = a <= 0.5 ? a * (n + 1) : a + n - a * n, o = a * 2 - i;
return e = e || [], lr(e, Pr(Mc(o, i, t + 1 / 3) * 255), Pr(Mc(o, i, t) * 255), Pr(Mc(o, i, t - 1 / 3) * 255), 1), r.length === 4 && (e[3] = r[3]), e;
}
function cP(r) {
if (r) {
var e = r[0] / 255, t = r[1] / 255, n = r[2] / 255, a = Math.min(e, t, n), i = Math.max(e, t, n), o = i - a, s = (i + a) / 2, l, u;
if (o === 0)
l = 0, u = 0;
else {
s < 0.5 ? u = o / (i + a) : u = o / (2 - i - a);
var h = ((i - e) / 6 + o / 2) / o, f = ((i - t) / 6 + o / 2) / o, c = ((i - n) / 6 + o / 2) / o;
e === i ? l = c - f : t === i ? l = 1 / 3 + h - c : n === i && (l = 2 / 3 + f - h), l < 0 && (l += 1), l > 1 && (l -= 1);
}
var v = [l * 360, u, s];
return r[3] != null && v.push(r[3]), v;
}
}
function sd(r, e) {
var t = er(r);
if (t) {
for (var n = 0; n < 3; n++)
e < 0 ? t[n] = t[n] * (1 - e) | 0 : t[n] = (255 - t[n]) * e + t[n] | 0, t[n] > 255 ? t[n] = 255 : t[n] < 0 && (t[n] = 0);
return bn(t, t.length === 4 ? "rgba" : "rgb");
}
}
function Ic(r, e, t) {
if (!(!(e && e.length) || !(r >= 0 && r <= 1))) {
t = t || [];
var n = r * (e.length - 1), a = Math.floor(n), i = Math.ceil(n), o = e[a], s = e[i], l = n - a;
return t[0] = Pr(ea(o[0], s[0], l)), t[1] = Pr(ea(o[1], s[1], l)), t[2] = Pr(ea(o[2], s[2], l)), t[3] = ll(ea(o[3], s[3], l)), t;
}
}
function vP(r, e, t) {
if (!(!(e && e.length) || !(r >= 0 && r <= 1))) {
var n = r * (e.length - 1), a = Math.floor(n), i = Math.ceil(n), o = er(e[a]), s = er(e[i]), l = n - a, u = bn([
Pr(ea(o[0], s[0], l)),
Pr(ea(o[1], s[1], l)),
Pr(ea(o[2], s[2], l)),
ll(ea(o[3], s[3], l))
], "rgba");
return t ? {
color: u,
leftIndex: a,
rightIndex: i,
value: n
} : u;
}
}
function Ys(r, e, t, n) {
var a = er(r);
if (r)
return a = cP(a), e != null && (a[0] = fP(e)), t != null && (a[1] = hi(t)), n != null && (a[2] = hi(n)), bn(od(a), "rgba");
}
function Ph(r, e) {
var t = er(r);
if (t && e != null)
return t[3] = ll(e), bn(t, "rgba");
}
function bn(r, e) {
if (!(!r || !r.length)) {
var t = r[0] + "," + r[1] + "," + r[2];
return (e === "rgba" || e === "hsva" || e === "hsla") && (t += "," + r[3]), e + "(" + t + ")";
}
}
function kh(r, e) {
var t = er(r);
return t ? (0.299 * t[0] + 0.587 * t[1] + 0.114 * t[2]) * t[3] / 255 + (1 - t[3]) * e : 0;
}
var I0 = new Rl(100);
function ld(r) {
if (U(r)) {
var e = I0.get(r);
return e || (e = sd(r, -0.1), I0.put(r, e)), e;
} else if (Ef(r)) {
var t = B({}, r);
return t.colorStops = G(r.colorStops, function(n) {
return {
offset: n.offset,
color: sd(n.color, -0.1)
};
}), t;
}
return r;
}
var Rh = Math.round;
function ul(r) {
var e;
if (!r || r === "transparent")
r = "none";
else if (typeof r == "string" && r.indexOf("rgba") > -1) {
var t = er(r);
t && (r = "rgb(" + t[0] + "," + t[1] + "," + t[2] + ")", e = t[3]);
}
return {
color: r,
opacity: e ?? 1
};
}
var pP = 1e-4;
function ra(r) {
return r < pP && r > -1e-4;
}
function lu(r) {
return Rh(r * 1e3) / 1e3;
}
function ud(r) {
return Rh(r * 1e4) / 1e4;
}
function dP(r) {
return "matrix(" + lu(r[0]) + "," + lu(r[1]) + "," + lu(r[2]) + "," + lu(r[3]) + "," + ud(r[4]) + "," + ud(r[5]) + ")";
}
var gP = {
left: "start",
right: "end",
center: "middle",
middle: "middle"
};
function yP(r, e, t) {
return t === "top" ? r += e / 2 : t === "bottom" && (r -= e / 2), r;
}
function mP(r) {
return r && (r.shadowBlur || r.shadowOffsetX || r.shadowOffsetY);
}
function _P(r) {
var e = r.style, t = r.getGlobalScale();
return [
e.shadowColor,
(e.shadowBlur || 0).toFixed(2),
(e.shadowOffsetX || 0).toFixed(2),
(e.shadowOffsetY || 0).toFixed(2),
t[0],
t[1]
].join(",");
}
function tC(r) {
return r && !!r.image;
}
function SP(r) {
return r && !!r.svgElement;
}
function iy(r) {
return tC(r) || SP(r);
}
function eC(r) {
return r.type === "linear";
}
function rC(r) {
return r.type === "radial";
}
function nC(r) {
return r && (r.type === "linear" || r.type === "radial");
}
function Rf(r) {
return "url(#" + r + ")";
}
function aC(r) {
var e = r.getGlobalScale(), t = Math.max(e[0], e[1]);
return Math.max(Math.ceil(Math.log(t) / Math.log(10)), 1);
}
function iC(r) {
var e = r.x || 0, t = r.y || 0, n = (r.rotation || 0) * ah, a = ot(r.scaleX, 1), i = ot(r.scaleY, 1), o = r.skewX || 0, s = r.skewY || 0, l = [];
return (e || t) && l.push("translate(" + e + "px," + t + "px)"), n && l.push("rotate(" + n + ")"), (a !== 1 || i !== 1) && l.push("scale(" + a + "," + i + ")"), (o || s) && l.push("skew(" + Rh(o * ah) + "deg, " + Rh(s * ah) + "deg)"), l.join(" ");
}
var xP = function() {
return yt.hasGlobalWindow && K(window.btoa) ? function(r) {
return window.btoa(unescape(encodeURIComponent(r)));
} : typeof Buffer < "u" ? function(r) {
return Buffer.from(r).toString("base64");
} : function(r) {
return process.env.NODE_ENV !== "production" && Er("Base64 isn't natively supported in the current environment."), null;
};
}(), hd = Array.prototype.slice;
function pn(r, e, t) {
return (e - r) * t + r;
}
function Lc(r, e, t, n) {
for (var a = e.length, i = 0; i < a; i++)
r[i] = pn(e[i], t[i], n);
return r;
}
function bP(r, e, t, n) {
for (var a = e.length, i = a && e[0].length, o = 0; o < a; o++) {
r[o] || (r[o] = []);
for (var s = 0; s < i; s++)
r[o][s] = pn(e[o][s], t[o][s], n);
}
return r;
}
function uu(r, e, t, n) {
for (var a = e.length, i = 0; i < a; i++)
r[i] = e[i] + t[i] * n;
return r;
}
function L0(r, e, t, n) {
for (var a = e.length, i = a && e[0].length, o = 0; o < a; o++) {
r[o] || (r[o] = []);
for (var s = 0; s < i; s++)
r[o][s] = e[o][s] + t[o][s] * n;
}
return r;
}
function wP(r, e) {
for (var t = r.length, n = e.length, a = t > n ? e : r, i = Math.min(t, n), o = a[i - 1] || { color: [0, 0, 0, 0], offset: 0 }, s = i; s < Math.max(t, n); s++)
a.push({
offset: o.offset,
color: o.color.slice()
});
}
function TP(r, e, t) {
var n = r, a = e;
if (!(!n.push || !a.push)) {
var i = n.length, o = a.length;
if (i !== o) {
var s = i > o;
if (s)
n.length = o;
else
for (var l = i; l < o; l++)
n.push(t === 1 ? a[l] : hd.call(a[l]));
}
for (var u = n[0] && n[0].length, l = 0; l < n.length; l++)
if (t === 1)
isNaN(n[l]) && (n[l] = a[l]);
else
for (var h = 0; h < u; h++)
isNaN(n[l][h]) && (n[l][h] = a[l][h]);
}
}
function Zs(r) {
if (De(r)) {
var e = r.length;
if (De(r[0])) {
for (var t = [], n = 0; n < e; n++)
t.push(hd.call(r[n]));
return t;
}
return hd.call(r);
}
return r;
}
function uh(r) {
return r[0] = Math.floor(r[0]) || 0, r[1] = Math.floor(r[1]) || 0, r[2] = Math.floor(r[2]) || 0, r[3] = r[3] == null ? 1 : r[3], "rgba(" + r.join(",") + ")";
}
function CP(r) {
return De(r && r[0]) ? 2 : 1;
}
var hu = 0, hh = 1, oC = 2, Es = 3, fd = 4, cd = 5, E0 = 6;
function P0(r) {
return r === fd || r === cd;
}
function fu(r) {
return r === hh || r === oC;
}
var is = [0, 0, 0, 0], DP = function() {
function r(e) {
this.keyframes = [], this.discrete = !1, this._invalid = !1, this._needsSort = !1, this._lastFr = 0, this._lastFrP = 0, this.propName = e;
}
return r.prototype.isFinished = function() {
return this._finished;
}, r.prototype.setFinished = function() {
this._finished = !0, this._additiveTrack && this._additiveTrack.setFinished();
}, r.prototype.needsAnimate = function() {
return this.keyframes.length >= 1;
}, r.prototype.getAdditiveTrack = function() {
return this._additiveTrack;
}, r.prototype.addKeyframe = function(e, t, n) {
this._needsSort = !0;
var a = this.keyframes, i = a.length, o = !1, s = E0, l = t;
if (De(t)) {
var u = CP(t);
s = u, (u === 1 && !Tt(t[0]) || u === 2 && !Tt(t[0][0])) && (o = !0);
} else if (Tt(t) && !Si(t))
s = hu;
else if (U(t))
if (!isNaN(+t))
s = hu;
else {
var h = er(t);
h && (l = h, s = Es);
}
else if (Ef(t)) {
var f = B({}, l);
f.colorStops = G(t.colorStops, function(v) {
return {
offset: v.offset,
color: er(v.color)
};
}), eC(t) ? s = fd : rC(t) && (s = cd), l = f;
}
i === 0 ? this.valType = s : (s !== this.valType || s === E0) && (o = !0), this.discrete = this.discrete || o;
var c = {
time: e,
value: l,
rawValue: t,
percent: 0
};
return n && (c.easing = n, c.easingFunc = K(n) ? n : Us[n] || ay(n)), a.push(c), c;
}, r.prototype.prepare = function(e, t) {
var n = this.keyframes;
this._needsSort && n.sort(function(d, g) {
return d.time - g.time;
});
for (var a = this.valType, i = n.length, o = n[i - 1], s = this.discrete, l = fu(a), u = P0(a), h = 0; h < i; h++) {
var f = n[h], c = f.value, v = o.value;
f.percent = f.time / e, s || (l && h !== i - 1 ? TP(c, v, a) : u && wP(c.colorStops, v.colorStops));
}
if (!s && a !== cd && t && this.needsAnimate() && t.needsAnimate() && a === t.valType && !t._finished) {
this._additiveTrack = t;
for (var p = n[0].value, h = 0; h < i; h++)
a === hu ? n[h].additiveValue = n[h].value - p : a === Es ? n[h].additiveValue = uu([], n[h].value, p, -1) : fu(a) && (n[h].additiveValue = a === hh ? uu([], n[h].value, p, -1) : L0([], n[h].value, p, -1));
}
}, r.prototype.step = function(e, t) {
if (!this._finished) {
this._additiveTrack && this._additiveTrack._finished && (this._additiveTrack = null);
var n = this._additiveTrack != null, a = n ? "additiveValue" : "value", i = this.valType, o = this.keyframes, s = o.length, l = this.propName, u = i === Es, h, f = this._lastFr, c = Math.min, v, p;
if (s === 1)
v = p = o[0];
else {
if (t < 0)
h = 0;
else if (t < this._lastFrP) {
var d = c(f + 1, s - 1);
for (h = d; h >= 0 && !(o[h].percent <= t); h--)
;
h = c(h, s - 2);
} else {
for (h = f; h < s && !(o[h].percent > t); h++)
;
h = c(h - 1, s - 2);
}
p = o[h + 1], v = o[h];
}
if (v && p) {
this._lastFr = h, this._lastFrP = t;
var g = p.percent - v.percent, y = g === 0 ? 1 : c((t - v.percent) / g, 1);
p.easingFunc && (y = p.easingFunc(y));
var m = n ? this._additiveValue : u ? is : e[l];
if ((fu(i) || u) && !m && (m = this._additiveValue = []), this.discrete)
e[l] = y < 1 ? v.rawValue : p.rawValue;
else if (fu(i))
i === hh ? Lc(m, v[a], p[a], y) : bP(m, v[a], p[a], y);
else if (P0(i)) {
var _ = v[a], S = p[a], x = i === fd;
e[l] = {
type: x ? "linear" : "radial",
x: pn(_.x, S.x, y),
y: pn(_.y, S.y, y),
colorStops: G(_.colorStops, function(w, T) {
var C = S.colorStops[T];
return {
offset: pn(w.offset, C.offset, y),
color: uh(Lc([], w.color, C.color, y))
};
}),
global: S.global
}, x ? (e[l].x2 = pn(_.x2, S.x2, y), e[l].y2 = pn(_.y2, S.y2, y)) : e[l].r = pn(_.r, S.r, y);
} else if (u)
Lc(m, v[a], p[a], y), n || (e[l] = uh(m));
else {
var b = pn(v[a], p[a], y);
n ? this._additiveValue = b : e[l] = b;
}
n && this._addToTarget(e);
}
}
}, r.prototype._addToTarget = function(e) {
var t = this.valType, n = this.propName, a = this._additiveValue;
t === hu ? e[n] = e[n] + a : t === Es ? (er(e[n], is), uu(is, is, a, 1), e[n] = uh(is)) : t === hh ? uu(e[n], e[n], a, 1) : t === oC && L0(e[n], e[n], a, 1);
}, r;
}(), oy = function() {
function r(e, t, n, a) {
if (this._tracks = {}, this._trackKeys = [], this._maxTime = 0, this._started = 0, this._clip = null, this._target = e, this._loop = t, t && a) {
Er("Can' use additive animation on looped animation.");
return;
}
this._additiveAnimators = a, this._allowDiscrete = n;
}
return r.prototype.getMaxTime = function() {
return this._maxTime;
}, r.prototype.getDelay = function() {
return this._delay;
}, r.prototype.getLoop = function() {
return this._loop;
}, r.prototype.getTarget = function() {
return this._target;
}, r.prototype.changeTarget = function(e) {
this._target = e;
}, r.prototype.when = function(e, t, n) {
return this.whenWithKeys(e, t, St(t), n);
}, r.prototype.whenWithKeys = function(e, t, n, a) {
for (var i = this._tracks, o = 0; o < n.length; o++) {
var s = n[o], l = i[s];
if (!l) {
l = i[s] = new DP(s);
var u = void 0, h = this._getAdditiveTrack(s);
if (h) {
var f = h.keyframes, c = f[f.length - 1];
u = c && c.value, h.valType === Es && u && (u = uh(u));
} else
u = this._target[s];
if (u == null)
continue;
e > 0 && l.addKeyframe(0, Zs(u), a), this._trackKeys.push(s);
}
l.addKeyframe(e, Zs(t[s]), a);
}
return this._maxTime = Math.max(this._maxTime, e), this;
}, r.prototype.pause = function() {
this._clip.pause(), this._paused = !0;
}, r.prototype.resume = function() {
this._clip.resume(), this._paused = !1;
}, r.prototype.isPaused = function() {
return !!this._paused;
}, r.prototype.duration = function(e) {
return this._maxTime = e, this._force = !0, this;
}, r.prototype._doneCallback = function() {
this._setTracksFinished(), this._clip = null;
var e = this._doneCbs;
if (e)
for (var t = e.length, n = 0; n < t; n++)
e[n].call(this);
}, r.prototype._abortedCallback = function() {
this._setTracksFinished();
var e = this.animation, t = this._abortedCbs;
if (e && e.removeClip(this._clip), this._clip = null, t)
for (var n = 0; n < t.length; n++)
t[n].call(this);
}, r.prototype._setTracksFinished = function() {
for (var e = this._tracks, t = this._trackKeys, n = 0; n < t.length; n++)
e[t[n]].setFinished();
}, r.prototype._getAdditiveTrack = function(e) {
var t, n = this._additiveAnimators;
if (n)
for (var a = 0; a < n.length; a++) {
var i = n[a].getTrack(e);
i && (t = i);
}
return t;
}, r.prototype.start = function(e) {
if (!(this._started > 0)) {
this._started = 1;
for (var t = this, n = [], a = this._maxTime || 0, i = 0; i < this._trackKeys.length; i++) {
var o = this._trackKeys[i], s = this._tracks[o], l = this._getAdditiveTrack(o), u = s.keyframes, h = u.length;
if (s.prepare(a, l), s.needsAnimate())
if (!this._allowDiscrete && s.discrete) {
var f = u[h - 1];
f && (t._target[s.propName] = f.rawValue), s.setFinished();
} else
n.push(s);
}
if (n.length || this._force) {
var c = new uP({
life: a,
loop: this._loop,
delay: this._delay || 0,
onframe: function(v) {
t._started = 2;
var p = t._additiveAnimators;
if (p) {
for (var d = !1, g = 0; g < p.length; g++)
if (p[g]._clip) {
d = !0;
break;
}
d || (t._additiveAnimators = null);
}
for (var g = 0; g < n.length; g++)
n[g].step(t._target, v);
var y = t._onframeCbs;
if (y)
for (var g = 0; g < y.length; g++)
y[g](t._target, v);
},
ondestroy: function() {
t._doneCallback();
}
});
this._clip = c, this.animation && this.animation.addClip(c), e && c.setEasing(e);
} else
this._doneCallback();
return this;
}
}, r.prototype.stop = function(e) {
if (this._clip) {
var t = this._clip;
e && t.onframe(1), this._abortedCallback();
}
}, r.prototype.delay = function(e) {
return this._delay = e, this;
}, r.prototype.during = function(e) {
return e && (this._onframeCbs || (this._onframeCbs = []), this._onframeCbs.push(e)), this;
}, r.prototype.done = function(e) {
return e && (this._doneCbs || (this._doneCbs = []), this._doneCbs.push(e)), this;
}, r.prototype.aborted = function(e) {
return e && (this._abortedCbs || (this._abortedCbs = []), this._abortedCbs.push(e)), this;
}, r.prototype.getClip = function() {
return this._clip;
}, r.prototype.getTrack = function(e) {
return this._tracks[e];
}, r.prototype.getTracks = function() {
var e = this;
return G(this._trackKeys, function(t) {
return e._tracks[t];
});
}, r.prototype.stopTracks = function(e, t) {
if (!e.length || !this._clip)
return !0;
for (var n = this._tracks, a = this._trackKeys, i = 0; i < e.length; i++) {
var o = n[e[i]];
o && !o.isFinished() && (t ? o.step(this._target, 1) : this._started === 1 && o.step(this._target, 0), o.setFinished());
}
for (var s = !0, i = 0; i < a.length; i++)
if (!n[a[i]].isFinished()) {
s = !1;
break;
}
return s && this._abortedCallback(), s;
}, r.prototype.saveTo = function(e, t, n) {
if (e) {
t = t || this._trackKeys;
for (var a = 0; a < t.length; a++) {
var i = t[a], o = this._tracks[i];
if (!(!o || o.isFinished())) {
var s = o.keyframes, l = s[n ? 0 : s.length - 1];
l && (e[i] = Zs(l.rawValue));
}
}
}
}, r.prototype.__changeFinalValue = function(e, t) {
t = t || St(e);
for (var n = 0; n < t.length; n++) {
var a = t[n], i = this._tracks[a];
if (i) {
var o = i.keyframes;
if (o.length > 1) {
var s = o.pop();
i.addKeyframe(s.time, e[a]), i.prepare(this._maxTime, i.getAdditiveTrack());
}
}
}
}, r;
}();
function vo() {
return (/* @__PURE__ */ new Date()).getTime();
}
var AP = function(r) {
Ht(e, r);
function e(t) {
var n = r.call(this) || this;
return n._running = !1, n._time = 0, n._pausedTime = 0, n._pauseStart = 0, n._paused = !1, t = t || {}, n.stage = t.stage || {}, n;
}
return e.prototype.addClip = function(t) {
t.animation && this.removeClip(t), this._head ? (this._tail.next = t, t.prev = this._tail, t.next = null, this._tail = t) : this._head = this._tail = t, t.animation = this;
}, e.prototype.addAnimator = function(t) {
t.animation = this;
var n = t.getClip();
n && this.addClip(n);
}, e.prototype.removeClip = function(t) {
if (t.animation) {
var n = t.prev, a = t.next;
n ? n.next = a : this._head = a, a ? a.prev = n : this._tail = n, t.next = t.prev = t.animation = null;
}
}, e.prototype.removeAnimator = function(t) {
var n = t.getClip();
n && this.removeClip(n), t.animation = null;
}, e.prototype.update = function(t) {
for (var n = vo() - this._pausedTime, a = n - this._time, i = this._head; i; ) {
var o = i.next, s = i.step(n, a);
s && (i.ondestroy(), this.removeClip(i)), i = o;
}
this._time = n, t || (this.trigger("frame", a), this.stage.update && this.stage.update());
}, e.prototype._startLoop = function() {
var t = this;
this._running = !0;
function n() {
t._running && (Lh(n), !t._paused && t.update());
}
Lh(n);
}, e.prototype.start = function() {
this._running || (this._time = vo(), this._pausedTime = 0, this._startLoop());
}, e.prototype.stop = function() {
this._running = !1;
}, e.prototype.pause = function() {
this._paused || (this._pauseStart = vo(), this._paused = !0);
}, e.prototype.resume = function() {
this._paused && (this._pausedTime += vo() - this._pauseStart, this._paused = !1);
}, e.prototype.clear = function() {
for (var t = this._head; t; ) {
var n = t.next;
t.prev = t.next = t.animation = null, t = n;
}
this._head = this._tail = null;
}, e.prototype.isFinished = function() {
return this._head == null;
}, e.prototype.animate = function(t, n) {
n = n || {}, this.start();
var a = new oy(t, n.loop);
return this.addAnimator(a), a;
}, e;
}(xr), MP = 300, Ec = yt.domSupported, Pc = function() {
var r = [
"click",
"dblclick",
"mousewheel",
"wheel",
"mouseout",
"mouseup",
"mousedown",
"mousemove",
"contextmenu"
], e = [
"touchstart",
"touchend",
"touchmove"
], t = {
pointerdown: 1,
pointerup: 1,
pointermove: 1,
pointerout: 1
}, n = G(r, function(a) {
var i = a.replace("mouse", "pointer");
return t.hasOwnProperty(i) ? i : a;
});
return {
mouse: r,
touch: e,
pointer: n
};
}(), k0 = {
mouse: ["mousemove", "mouseup"],
pointer: ["pointermove", "pointerup"]
}, R0 = !1;
function vd(r) {
var e = r.pointerType;
return e === "pen" || e === "touch";
}
function IP(r) {
r.touching = !0, r.touchTimer != null && (clearTimeout(r.touchTimer), r.touchTimer = null), r.touchTimer = setTimeout(function() {
r.touching = !1, r.touchTimer = null;
}, 700);
}
function kc(r) {
r && (r.zrByTouch = !0);
}
function LP(r, e) {
return ur(r.dom, new EP(r, e), !0);
}
function sC(r, e) {
for (var t = e, n = !1; t && t.nodeType !== 9 && !(n = t.domBelongToZr || t !== e && t === r.painterRoot); )
t = t.parentNode;
return n;
}
var EP = /* @__PURE__ */ function() {
function r(e, t) {
this.stopPropagation = Jt, this.stopImmediatePropagation = Jt, this.preventDefault = Jt, this.type = t.type, this.target = this.currentTarget = e.dom, this.pointerType = t.pointerType, this.clientX = t.clientX, this.clientY = t.clientY;
}
return r;
}(), Dr = {
mousedown: function(r) {
r = ur(this.dom, r), this.__mayPointerCapture = [r.zrX, r.zrY], this.trigger("mousedown", r);
},
mousemove: function(r) {
r = ur(this.dom, r);
var e = this.__mayPointerCapture;
e && (r.zrX !== e[0] || r.zrY !== e[1]) && this.__togglePointerCapture(!0), this.trigger("mousemove", r);
},
mouseup: function(r) {
r = ur(this.dom, r), this.__togglePointerCapture(!1), this.trigger("mouseup", r);
},
mouseout: function(r) {
r = ur(this.dom, r);
var e = r.toElement || r.relatedTarget;
sC(this, e) || (this.__pointerCapturing && (r.zrEventControl = "no_globalout"), this.trigger("mouseout", r));
},
wheel: function(r) {
R0 = !0, r = ur(this.dom, r), this.trigger("mousewheel", r);
},
mousewheel: function(r) {
R0 || (r = ur(this.dom, r), this.trigger("mousewheel", r));
},
touchstart: function(r) {
r = ur(this.dom, r), kc(r), this.__lastTouchMoment = /* @__PURE__ */ new Date(), this.handler.processGesture(r, "start"), Dr.mousemove.call(this, r), Dr.mousedown.call(this, r);
},
touchmove: function(r) {
r = ur(this.dom, r), kc(r), this.handler.processGesture(r, "change"), Dr.mousemove.call(this, r);
},
touchend: function(r) {
r = ur(this.dom, r), kc(r), this.handler.processGesture(r, "end"), Dr.mouseup.call(this, r), +/* @__PURE__ */ new Date() - +this.__lastTouchMoment < MP && Dr.click.call(this, r);
},
pointerdown: function(r) {
Dr.mousedown.call(this, r);
},
pointermove: function(r) {
vd(r) || Dr.mousemove.call(this, r);
},
pointerup: function(r) {
Dr.mouseup.call(this, r);
},
pointerout: function(r) {
vd(r) || Dr.mouseout.call(this, r);
}
};
A(["click", "dblclick", "contextmenu"], function(r) {
Dr[r] = function(e) {
e = ur(this.dom, e), this.trigger(r, e);
};
});
var pd = {
pointermove: function(r) {
vd(r) || pd.mousemove.call(this, r);
},
pointerup: function(r) {
pd.mouseup.call(this, r);
},
mousemove: function(r) {
this.trigger("mousemove", r);
},
mouseup: function(r) {
var e = this.__pointerCapturing;
this.__togglePointerCapture(!1), this.trigger("mouseup", r), e && (r.zrEventControl = "only_globalout", this.trigger("mouseout", r));
}
};
function PP(r, e) {
var t = e.domHandlers;
yt.pointerEventsSupported ? A(Pc.pointer, function(n) {
fh(e, n, function(a) {
t[n].call(r, a);
});
}) : (yt.touchEventsSupported && A(Pc.touch, function(n) {
fh(e, n, function(a) {
t[n].call(r, a), IP(e);
});
}), A(Pc.mouse, function(n) {
fh(e, n, function(a) {
a = ey(a), e.touching || t[n].call(r, a);
});
}));
}
function kP(r, e) {
yt.pointerEventsSupported ? A(k0.pointer, t) : yt.touchEventsSupported || A(k0.mouse, t);
function t(n) {
function a(i) {
i = ey(i), sC(r, i.target) || (i = LP(r, i), e.domHandlers[n].call(r, i));
}
fh(e, n, a, { capture: !0 });
}
}
function fh(r, e, t, n) {
r.mounted[e] = t, r.listenerOpts[e] = n, nd(r.domTarget, e, t, n);
}
function Rc(r) {
var e = r.mounted;
for (var t in e)
e.hasOwnProperty(t) && YE(r.domTarget, t, e[t], r.listenerOpts[t]);
r.mounted = {};
}
var N0 = /* @__PURE__ */ function() {
function r(e, t) {
this.mounted = {}, this.listenerOpts = {}, this.touching = !1, this.domTarget = e, this.domHandlers = t;
}
return r;
}(), RP = function(r) {
Ht(e, r);
function e(t, n) {
var a = r.call(this) || this;
return a.__pointerCapturing = !1, a.dom = t, a.painterRoot = n, a._localHandlerScope = new N0(t, Dr), Ec && (a._globalHandlerScope = new N0(document, pd)), PP(a, a._localHandlerScope), a;
}
return e.prototype.dispose = function() {
Rc(this._localHandlerScope), Ec && Rc(this._globalHandlerScope);
}, e.prototype.setCursor = function(t) {
this.dom.style && (this.dom.style.cursor = t || "default");
}, e.prototype.__togglePointerCapture = function(t) {
if (this.__mayPointerCapture = null, Ec && +this.__pointerCapturing ^ +t) {
this.__pointerCapturing = t;
var n = this._globalHandlerScope;
t ? kP(this, n) : Rc(n);
}
}, e;
}(xr), lC = 1;
yt.hasGlobalWindow && (lC = Math.max(window.devicePixelRatio || window.screen && window.screen.deviceXDPI / window.screen.logicalXDPI || 1, 1));
var Nh = lC, dd = 0.4, gd = "#333", yd = "#ccc", NP = "#eee", O0 = kf, OP = 5e-5;
function Ca(r) {
return r > OP || r < -5e-5;
}
var Da = [], Gi = [], Nc = tr(), Oc = Math.abs, mn = function() {
function r() {
}
return r.prototype.getLocalTransform = function(e) {
return r.getLocalTransform(this, e);
}, r.prototype.setPosition = function(e) {
this.x = e[0], this.y = e[1];
}, r.prototype.setScale = function(e) {
this.scaleX = e[0], this.scaleY = e[1];
}, r.prototype.setSkew = function(e) {
this.skewX = e[0], this.skewY = e[1];
}, r.prototype.setOrigin = function(e) {
this.originX = e[0], this.originY = e[1];
}, r.prototype.needLocalTransform = function() {
return Ca(this.rotation) || Ca(this.x) || Ca(this.y) || Ca(this.scaleX - 1) || Ca(this.scaleY - 1) || Ca(this.skewX) || Ca(this.skewY);
}, r.prototype.updateTransform = function() {
var e = this.parent && this.parent.transform, t = this.needLocalTransform(), n = this.transform;
if (!(t || e)) {
n && (O0(n), this.invTransform = null);
return;
}
n = n || tr(), t ? this.getLocalTransform(n) : O0(n), e && (t ? xn(n, e, n) : ry(n, e)), this.transform = n, this._resolveGlobalScaleRatio(n);
}, r.prototype._resolveGlobalScaleRatio = function(e) {
var t = this.globalScaleRatio;
if (t != null && t !== 1) {
this.getGlobalScale(Da);
var n = Da[0] < 0 ? -1 : 1, a = Da[1] < 0 ? -1 : 1, i = ((Da[0] - n) * t + n) / Da[0] || 0, o = ((Da[1] - a) * t + a) / Da[1] || 0;
e[0] *= i, e[1] *= i, e[2] *= o, e[3] *= o;
}
this.invTransform = this.invTransform || tr(), Vo(this.invTransform, e);
}, r.prototype.getComputedTransform = function() {
for (var e = this, t = []; e; )
t.push(e), e = e.parent;
for (; e = t.pop(); )
e.updateTransform();
return this.transform;
}, r.prototype.setLocalTransform = function(e) {
if (e) {
var t = e[0] * e[0] + e[1] * e[1], n = e[2] * e[2] + e[3] * e[3], a = Math.atan2(e[1], e[0]), i = Math.PI / 2 + a - Math.atan2(e[3], e[2]);
n = Math.sqrt(n) * Math.cos(i), t = Math.sqrt(t), this.skewX = i, this.skewY = 0, this.rotation = -a, this.x = +e[4], this.y = +e[5], this.scaleX = t, this.scaleY = n, this.originX = 0, this.originY = 0;
}
}, r.prototype.decomposeTransform = function() {
if (this.transform) {
var e = this.parent, t = this.transform;
e && e.transform && (e.invTransform = e.invTransform || tr(), xn(Gi, e.invTransform, t), t = Gi);
var n = this.originX, a = this.originY;
(n || a) && (Nc[4] = n, Nc[5] = a, xn(Gi, t, Nc), Gi[4] -= n, Gi[5] -= a, t = Gi), this.setLocalTransform(t);
}
}, r.prototype.getGlobalScale = function(e) {
var t = this.transform;
return e = e || [], t ? (e[0] = Math.sqrt(t[0] * t[0] + t[1] * t[1]), e[1] = Math.sqrt(t[2] * t[2] + t[3] * t[3]), t[0] < 0 && (e[0] = -e[0]), t[3] < 0 && (e[1] = -e[1]), e) : (e[0] = 1, e[1] = 1, e);
}, r.prototype.transformCoordToLocal = function(e, t) {
var n = [e, t], a = this.invTransform;
return a && me(n, n, a), n;
}, r.prototype.transformCoordToGlobal = function(e, t) {
var n = [e, t], a = this.transform;
return a && me(n, n, a), n;
}, r.prototype.getLineScale = function() {
var e = this.transform;
return e && Oc(e[0] - 1) > 1e-10 && Oc(e[3] - 1) > 1e-10 ? Math.sqrt(Oc(e[0] * e[3] - e[2] * e[1])) : 1;
}, r.prototype.copyTransform = function(e) {
uC(this, e);
}, r.getLocalTransform = function(e, t) {
t = t || [];
var n = e.originX || 0, a = e.originY || 0, i = e.scaleX, o = e.scaleY, s = e.anchorX, l = e.anchorY, u = e.rotation || 0, h = e.x, f = e.y, c = e.skewX ? Math.tan(e.skewX) : 0, v = e.skewY ? Math.tan(-e.skewY) : 0;
if (n || a || s || l) {
var p = n + s, d = a + l;
t[4] = -p * i - c * d * o, t[5] = -d * o - v * p * i;
} else
t[4] = t[5] = 0;
return t[0] = i, t[3] = o, t[1] = v * i, t[2] = c * o, u && Li(t, t, u), t[4] += n + h, t[5] += a + f, t;
}, r.initDefaultProps = function() {
var e = r.prototype;
e.scaleX = e.scaleY = e.globalScaleRatio = 1, e.x = e.y = e.originX = e.originY = e.skewX = e.skewY = e.rotation = e.anchorX = e.anchorY = 0;
}(), r;
}(), an = [
"x",
"y",
"originX",
"originY",
"anchorX",
"anchorY",
"rotation",
"scaleX",
"scaleY",
"skewX",
"skewY"
];
function uC(r, e) {
for (var t = 0; t < an.length; t++) {
var n = an[t];
r[n] = e[n];
}
}
var V0 = {};
function rr(r, e) {
e = e || ua;
var t = V0[e];
t || (t = V0[e] = new Rl(500));
var n = t.get(r);
return n == null && (n = ha.measureText(r, e).width, t.put(r, n)), n;
}
function B0(r, e, t, n) {
var a = rr(r, e), i = Nf(e), o = Ps(0, a, t), s = uo(0, i, n), l = new ct(o, s, a, i);
return l;
}
function Nl(r, e, t, n) {
var a = ((r || "") + "").split(`
`), i = a.length;
if (i === 1)
return B0(a[0], e, t, n);
for (var o = new ct(0, 0, 0, 0), s = 0; s < a.length; s++) {
var l = B0(a[s], e, t, n);
s === 0 ? o.copy(l) : o.union(l);
}
return o;
}
function Ps(r, e, t) {
return t === "right" ? r -= e : t === "center" && (r -= e / 2), r;
}
function uo(r, e, t) {
return t === "middle" ? r -= e / 2 : t === "bottom" && (r -= e), r;
}
function Nf(r) {
return rr("国", r);
}
function Rr(r, e) {
return typeof r == "string" ? r.lastIndexOf("%") >= 0 ? parseFloat(r) / 100 * e : parseFloat(r) : r;
}
function Oh(r, e, t) {
var n = e.position || "inside", a = e.distance != null ? e.distance : 5, i = t.height, o = t.width, s = i / 2, l = t.x, u = t.y, h = "left", f = "top";
if (n instanceof Array)
l += Rr(n[0], t.width), u += Rr(n[1], t.height), h = null, f = null;
else
switch (n) {
case "left":
l -= a, u += s, h = "right", f = "middle";
break;
case "right":
l += a + o, u += s, f = "middle";
break;
case "top":
l += o / 2, u -= a, h = "center", f = "bottom";
break;
case "bottom":
l += o / 2, u += i + a, h = "center";
break;
case "inside":
l += o / 2, u += s, h = "center", f = "middle";
break;
case "insideLeft":
l += a, u += s, f = "middle";
break;
case "insideRight":
l += o - a, u += s, h = "right", f = "middle";
break;
case "insideTop":
l += o / 2, u += a, h = "center";
break;
case "insideBottom":
l += o / 2, u += i - a, h = "center", f = "bottom";
break;
case "insideTopLeft":
l += a, u += a;
break;
case "insideTopRight":
l += o - a, u += a, h = "right";
break;
case "insideBottomLeft":
l += a, u += i - a, f = "bottom";
break;
case "insideBottomRight":
l += o - a, u += i - a, h = "right", f = "bottom";
break;
}
return r = r || {}, r.x = l, r.y = u, r.align = h, r.verticalAlign = f, r;
}
var Vc = "__zr_normal__", Bc = an.concat(["ignore"]), VP = rn(an, function(r, e) {
return r[e] = !0, r;
}, { ignore: !1 }), Fi = {}, BP = new ct(0, 0, 0, 0), Of = function() {
function r(e) {
this.id = NT(), this.animators = [], this.currentStates = [], this.states = {}, this._init(e);
}
return r.prototype._init = function(e) {
this.attr(e);
}, r.prototype.drift = function(e, t, n) {
switch (this.draggable) {
case "horizontal":
t = 0;
break;
case "vertical":
e = 0;
break;
}
var a = this.transform;
a || (a = this.transform = [1, 0, 0, 1, 0, 0]), a[4] += e, a[5] += t, this.decomposeTransform(), this.markRedraw();
}, r.prototype.beforeUpdate = function() {
}, r.prototype.afterUpdate = function() {
}, r.prototype.update = function() {
this.updateTransform(), this.__dirty && this.updateInnerText();
}, r.prototype.updateInnerText = function(e) {
var t = this._textContent;
if (t && (!t.ignore || e)) {
this.textConfig || (this.textConfig = {});
var n = this.textConfig, a = n.local, i = t.innerTransformable, o = void 0, s = void 0, l = !1;
i.parent = a ? this : null;
var u = !1;
if (i.copyTransform(t), n.position != null) {
var h = BP;
n.layoutRect ? h.copy(n.layoutRect) : h.copy(this.getBoundingRect()), a || h.applyTransform(this.transform), this.calculateTextPosition ? this.calculateTextPosition(Fi, n, h) : Oh(Fi, n, h), i.x = Fi.x, i.y = Fi.y, o = Fi.align, s = Fi.verticalAlign;
var f = n.origin;
if (f && n.rotation != null) {
var c = void 0, v = void 0;
f === "center" ? (c = h.width * 0.5, v = h.height * 0.5) : (c = Rr(f[0], h.width), v = Rr(f[1], h.height)), u = !0, i.originX = -i.x + c + (a ? 0 : h.x), i.originY = -i.y + v + (a ? 0 : h.y);
}
}
n.rotation != null && (i.rotation = n.rotation);
var p = n.offset;
p && (i.x += p[0], i.y += p[1], u || (i.originX = -p[0], i.originY = -p[1]));
var d = n.inside == null ? typeof n.position == "string" && n.position.indexOf("inside") >= 0 : n.inside, g = this._innerTextDefaultStyle || (this._innerTextDefaultStyle = {}), y = void 0, m = void 0, _ = void 0;
d && this.canBeInsideText() ? (y = n.insideFill, m = n.insideStroke, (y == null || y === "auto") && (y = this.getInsideTextFill()), (m == null || m === "auto") && (m = this.getInsideTextStroke(y), _ = !0)) : (y = n.outsideFill, m = n.outsideStroke, (y == null || y === "auto") && (y = this.getOutsideFill()), (m == null || m === "auto") && (m = this.getOutsideStroke(y), _ = !0)), y = y || "#000", (y !== g.fill || m !== g.stroke || _ !== g.autoStroke || o !== g.align || s !== g.verticalAlign) && (l = !0, g.fill = y, g.stroke = m, g.autoStroke = _, g.align = o, g.verticalAlign = s, t.setDefaultTextStyle(g)), t.__dirty |= tn, l && t.dirtyStyle(!0);
}
}, r.prototype.canBeInsideText = function() {
return !0;
}, r.prototype.getInsideTextFill = function() {
return "#fff";
}, r.prototype.getInsideTextStroke = function(e) {
return "#000";
}, r.prototype.getOutsideFill = function() {
return this.__zr && this.__zr.isDarkMode() ? yd : gd;
}, r.prototype.getOutsideStroke = function(e) {
var t = this.__zr && this.__zr.getBackgroundColor(), n = typeof t == "string" && er(t);
n || (n = [255, 255, 255, 1]);
for (var a = n[3], i = this.__zr.isDarkMode(), o = 0; o < 3; o++)
n[o] = n[o] * a + (i ? 0 : 255) * (1 - a);
return n[3] = 1, bn(n, "rgba");
}, r.prototype.traverse = function(e, t) {
}, r.prototype.attrKV = function(e, t) {
e === "textConfig" ? this.setTextConfig(t) : e === "textContent" ? this.setTextContent(t) : e === "clipPath" ? this.setClipPath(t) : e === "extra" ? (this.extra = this.extra || {}, B(this.extra, t)) : this[e] = t;
}, r.prototype.hide = function() {
this.ignore = !0, this.markRedraw();
}, r.prototype.show = function() {
this.ignore = !1, this.markRedraw();
}, r.prototype.attr = function(e, t) {
if (typeof e == "string")
this.attrKV(e, t);
else if (J(e))
for (var n = e, a = St(n), i = 0; i < a.length; i++) {
var o = a[i];
this.attrKV(o, e[o]);
}
return this.markRedraw(), this;
}, r.prototype.saveCurrentToNormalState = function(e) {
this._innerSaveToNormal(e);
for (var t = this._normalState, n = 0; n < this.animators.length; n++) {
var a = this.animators[n], i = a.__fromStateTransition;
if (!(a.getLoop() || i && i !== Vc)) {
var o = a.targetName, s = o ? t[o] : t;
a.saveTo(s);
}
}
}, r.prototype._innerSaveToNormal = function(e) {
var t = this._normalState;
t || (t = this._normalState = {}), e.textConfig && !t.textConfig && (t.textConfig = this.textConfig), this._savePrimaryToNormal(e, t, Bc);
}, r.prototype._savePrimaryToNormal = function(e, t, n) {
for (var a = 0; a < n.length; a++) {
var i = n[a];
e[i] != null && !(i in t) && (t[i] = this[i]);
}
}, r.prototype.hasState = function() {
return this.currentStates.length > 0;
}, r.prototype.getState = function(e) {
return this.states[e];
}, r.prototype.ensureState = function(e) {
var t = this.states;
return t[e] || (t[e] = {}), t[e];
}, r.prototype.clearStates = function(e) {
this.useState(Vc, !1, e);
}, r.prototype.useState = function(e, t, n, a) {
var i = e === Vc, o = this.hasState();
if (!(!o && i)) {
var s = this.currentStates, l = this.stateTransition;
if (!(pt(s, e) >= 0 && (t || s.length === 1))) {
var u;
if (this.stateProxy && !i && (u = this.stateProxy(e)), u || (u = this.states && this.states[e]), !u && !i) {
Er("State " + e + " not exists.");
return;
}
i || this.saveCurrentToNormalState(u);
var h = !!(u && u.hoverLayer || a);
h && this._toggleHoverLayerFlag(!0), this._applyStateObj(e, u, this._normalState, t, !n && !this.__inHover && l && l.duration > 0, l);
var f = this._textContent, c = this._textGuide;
return f && f.useState(e, t, n, h), c && c.useState(e, t, n, h), i ? (this.currentStates = [], this._normalState = {}) : t ? this.currentStates.push(e) : this.currentStates = [e], this._updateAnimationTargets(), this.markRedraw(), !h && this.__inHover && (this._toggleHoverLayerFlag(!1), this.__dirty &= -2), u;
}
}
}, r.prototype.useStates = function(e, t, n) {
if (!e.length)
this.clearStates();
else {
var a = [], i = this.currentStates, o = e.length, s = o === i.length;
if (s) {
for (var l = 0; l < o; l++)
if (e[l] !== i[l]) {
s = !1;
break;
}
}
if (s)
return;
for (var l = 0; l < o; l++) {
var u = e[l], h = void 0;
this.stateProxy && (h = this.stateProxy(u, e)), h || (h = this.states[u]), h && a.push(h);
}
var f = a[o - 1], c = !!(f && f.hoverLayer || n);
c && this._toggleHoverLayerFlag(!0);
var v = this._mergeStates(a), p = this.stateTransition;
this.saveCurrentToNormalState(v), this._applyStateObj(e.join(","), v, this._normalState, !1, !t && !this.__inHover && p && p.duration > 0, p);
var d = this._textContent, g = this._textGuide;
d && d.useStates(e, t, c), g && g.useStates(e, t, c), this._updateAnimationTargets(), this.currentStates = e.slice(), this.markRedraw(), !c && this.__inHover && (this._toggleHoverLayerFlag(!1), this.__dirty &= -2);
}
}, r.prototype.isSilent = function() {
for (var e = this.silent, t = this.parent; !e && t; ) {
if (t.silent) {
e = !0;
break;
}
t = t.parent;
}
return e;
}, r.prototype._updateAnimationTargets = function() {
for (var e = 0; e < this.animators.length; e++) {
var t = this.animators[e];
t.targetName && t.changeTarget(this[t.targetName]);
}
}, r.prototype.removeState = function(e) {
var t = pt(this.currentStates, e);
if (t >= 0) {
var n = this.currentStates.slice();
n.splice(t, 1), this.useStates(n);
}
}, r.prototype.replaceState = function(e, t, n) {
var a = this.currentStates.slice(), i = pt(a, e), o = pt(a, t) >= 0;
i >= 0 ? o ? a.splice(i, 1) : a[i] = t : n && !o && a.push(t), this.useStates(a);
}, r.prototype.toggleState = function(e, t) {
t ? this.useState(e, !0) : this.removeState(e);
}, r.prototype._mergeStates = function(e) {
for (var t = {}, n, a = 0; a < e.length; a++) {
var i = e[a];
B(t, i), i.textConfig && (n = n || {}, B(n, i.textConfig));
}
return n && (t.textConfig = n), t;
}, r.prototype._applyStateObj = function(e, t, n, a, i, o) {
var s = !(t && a);
t && t.textConfig ? (this.textConfig = B({}, a ? this.textConfig : n.textConfig), B(this.textConfig, t.textConfig)) : s && n.textConfig && (this.textConfig = n.textConfig);
for (var l = {}, u = !1, h = 0; h < Bc.length; h++) {
var f = Bc[h], c = i && VP[f];
t && t[f] != null ? c ? (u = !0, l[f] = t[f]) : this[f] = t[f] : s && n[f] != null && (c ? (u = !0, l[f] = n[f]) : this[f] = n[f]);
}
if (!i)
for (var h = 0; h < this.animators.length; h++) {
var v = this.animators[h], p = v.targetName;
v.getLoop() || v.__changeFinalValue(p ? (t || n)[p] : t || n);
}
u && this._transitionState(e, l, o);
}, r.prototype._attachComponent = function(e) {
if (e.__zr && !e.__hostTarget) {
if (process.env.NODE_ENV !== "production")
throw new Error("Text element has been added to zrender.");
return;
}
if (e === this) {
if (process.env.NODE_ENV !== "production")
throw new Error("Recursive component attachment.");
return;
}
var t = this.__zr;
t && e.addSelfToZr(t), e.__zr = t, e.__hostTarget = this;
}, r.prototype._detachComponent = function(e) {
e.__zr && e.removeSelfFromZr(e.__zr), e.__zr = null, e.__hostTarget = null;
}, r.prototype.getClipPath = function() {
return this._clipPath;
}, r.prototype.setClipPath = function(e) {
this._clipPath && this._clipPath !== e && this.removeClipPath(), this._attachComponent(e), this._clipPath = e, this.markRedraw();
}, r.prototype.removeClipPath = function() {
var e = this._clipPath;
e && (this._detachComponent(e), this._clipPath = null, this.markRedraw());
}, r.prototype.getTextContent = function() {
return this._textContent;
}, r.prototype.setTextContent = function(e) {
var t = this._textContent;
if (t !== e) {
if (t && t !== e && this.removeTextContent(), process.env.NODE_ENV !== "production" && e.__zr && !e.__hostTarget)
throw new Error("Text element has been added to zrender.");
e.innerTransformable = new mn(), this._attachComponent(e), this._textContent = e, this.markRedraw();
}
}, r.prototype.setTextConfig = function(e) {
this.textConfig || (this.textConfig = {}), B(this.textConfig, e), this.markRedraw();
}, r.prototype.removeTextConfig = function() {
this.textConfig = null, this.markRedraw();
}, r.prototype.removeTextContent = function() {
var e = this._textContent;
e && (e.innerTransformable = null, this._detachComponent(e), this._textContent = null, this._innerTextDefaultStyle = null, this.markRedraw());
}, r.prototype.getTextGuideLine = function() {
return this._textGuide;
}, r.prototype.setTextGuideLine = function(e) {
this._textGuide && this._textGuide !== e && this.removeTextGuideLine(), this._attachComponent(e), this._textGuide = e, this.markRedraw();
}, r.prototype.removeTextGuideLine = function() {
var e = this._textGuide;
e && (this._detachComponent(e), this._textGuide = null, this.markRedraw());
}, r.prototype.markRedraw = function() {
this.__dirty |= tn;
var e = this.__zr;
e && (this.__inHover ? e.refreshHover() : e.refresh()), this.__hostTarget && this.__hostTarget.markRedraw();
}, r.prototype.dirty = function() {
this.markRedraw();
}, r.prototype._toggleHoverLayerFlag = function(e) {
this.__inHover = e;
var t = this._textContent, n = this._textGuide;
t && (t.__inHover = e), n && (n.__inHover = e);
}, r.prototype.addSelfToZr = function(e) {
if (this.__zr !== e) {
this.__zr = e;
var t = this.animators;
if (t)
for (var n = 0; n < t.length; n++)
e.animation.addAnimator(t[n]);
this._clipPath && this._clipPath.addSelfToZr(e), this._textContent && this._textContent.addSelfToZr(e), this._textGuide && this._textGuide.addSelfToZr(e);
}
}, r.prototype.removeSelfFromZr = function(e) {
if (this.__zr) {
this.__zr = null;
var t = this.animators;
if (t)
for (var n = 0; n < t.length; n++)
e.animation.removeAnimator(t[n]);
this._clipPath && this._clipPath.removeSelfFromZr(e), this._textContent && this._textContent.removeSelfFromZr(e), this._textGuide && this._textGuide.removeSelfFromZr(e);
}
}, r.prototype.animate = function(e, t, n) {
var a = e ? this[e] : this;
if (process.env.NODE_ENV !== "production" && !a) {
Er('Property "' + e + '" is not existed in element ' + this.id);
return;
}
var i = new oy(a, t, n);
return e && (i.targetName = e), this.addAnimator(i, e), i;
}, r.prototype.addAnimator = function(e, t) {
var n = this.__zr, a = this;
e.during(function() {
a.updateDuringAnimation(t);
}).done(function() {
var i = a.animators, o = pt(i, e);
o >= 0 && i.splice(o, 1);
}), this.animators.push(e), n && n.animation.addAnimator(e), n && n.wakeUp();
}, r.prototype.updateDuringAnimation = function(e) {
this.markRedraw();
}, r.prototype.stopAnimation = function(e, t) {
for (var n = this.animators, a = n.length, i = [], o = 0; o < a; o++) {
var s = n[o];
!e || e === s.scope ? s.stop(t) : i.push(s);
}
return this.animators = i, this;
}, r.prototype.animateTo = function(e, t, n) {
zc(this, e, t, n);
}, r.prototype.animateFrom = function(e, t, n) {
zc(this, e, t, n, !0);
}, r.prototype._transitionState = function(e, t, n, a) {
for (var i = zc(this, t, n, a), o = 0; o < i.length; o++)
i[o].__fromStateTransition = e;
}, r.prototype.getBoundingRect = function() {
return null;
}, r.prototype.getPaintRect = function() {
return null;
}, r.initDefaultProps = function() {
var e = r.prototype;
e.type = "element", e.name = "", e.ignore = e.silent = e.isGroup = e.draggable = e.dragging = e.ignoreClip = e.__inHover = !1, e.__dirty = tn;
var t = {};
function n(i, o, s) {
t[i + o + s] || (console.warn("DEPRECATED: '" + i + "' has been deprecated. use '" + o + "', '" + s + "' instead"), t[i + o + s] = !0);
}
function a(i, o, s, l) {
Object.defineProperty(e, i, {
get: function() {
if (process.env.NODE_ENV !== "production" && n(i, s, l), !this[o]) {
var h = this[o] = [];
u(this, h);
}
return this[o];
},
set: function(h) {
process.env.NODE_ENV !== "production" && n(i, s, l), this[s] = h[0], this[l] = h[1], this[o] = h, u(this, h);
}
});
function u(h, f) {
Object.defineProperty(f, 0, {
get: function() {
return h[s];
},
set: function(c) {
h[s] = c;
}
}), Object.defineProperty(f, 1, {
get: function() {
return h[l];
},
set: function(c) {
h[l] = c;
}
});
}
}
Object.defineProperty && (a("position", "_legacyPos", "x", "y"), a("scale", "_legacyScale", "scaleX", "scaleY"), a("origin", "_legacyOrigin", "originX", "originY"));
}(), r;
}();
ie(Of, xr);
ie(Of, mn);
function zc(r, e, t, n, a) {
t = t || {};
var i = [];
hC(r, "", r, e, t, n, i, a);
var o = i.length, s = !1, l = t.done, u = t.aborted, h = function() {
s = !0, o--, o <= 0 && (s ? l && l() : u && u());
}, f = function() {
o--, o <= 0 && (s ? l && l() : u && u());
};
o || l && l(), i.length > 0 && t.during && i[0].during(function(p, d) {
t.during(d);
});
for (var c = 0; c < i.length; c++) {
var v = i[c];
h && v.done(h), f && v.aborted(f), t.force && v.duration(t.duration), v.start(t.easing);
}
return i;
}
function Gc(r, e, t) {
for (var n = 0; n < t; n++)
r[n] = e[n];
}
function zP(r) {
return De(r[0]);
}
function GP(r, e, t) {
if (De(e[t]))
if (De(r[t]) || (r[t] = []), Ve(e[t])) {
var n = e[t].length;
r[t].length !== n && (r[t] = new e[t].constructor(n), Gc(r[t], e[t], n));
} else {
var a = e[t], i = r[t], o = a.length;
if (zP(a))
for (var s = a[0].length, l = 0; l < o; l++)
i[l] ? Gc(i[l], a[l], s) : i[l] = Array.prototype.slice.call(a[l]);
else
Gc(i, a, o);
i.length = a.length;
}
else
r[t] = e[t];
}
function FP(r, e) {
return r === e || De(r) && De(e) && HP(r, e);
}
function HP(r, e) {
var t = r.length;
if (t !== e.length)
return !1;
for (var n = 0; n < t; n++)
if (r[n] !== e[n])
return !1;
return !0;
}
function hC(r, e, t, n, a, i, o, s) {
for (var l = St(n), u = a.duration, h = a.delay, f = a.additive, c = a.setToFinal, v = !J(i), p = r.animators, d = [], g = 0; g < l.length; g++) {
var y = l[g], m = n[y];
if (m != null && t[y] != null && (v || i[y]))
if (J(m) && !De(m) && !Ef(m)) {
if (e) {
s || (t[y] = m, r.updateDuringAnimation(e));
continue;
}
hC(r, y, t[y], m, a, i && i[y], o, s);
} else
d.push(y);
else s || (t[y] = m, r.updateDuringAnimation(e), d.push(y));
}
var _ = d.length;
if (!f && _)
for (var S = 0; S < p.length; S++) {
var x = p[S];
if (x.targetName === e) {
var b = x.stopTracks(d);
if (b) {
var w = pt(p, x);
p.splice(w, 1);
}
}
}
if (a.force || (d = At(d, function(M) {
return !FP(n[M], t[M]);
}), _ = d.length), _ > 0 || a.force && !o.length) {
var T = void 0, C = void 0, D = void 0;
if (s) {
C = {}, c && (T = {});
for (var S = 0; S < _; S++) {
var y = d[S];
C[y] = t[y], c ? T[y] = n[y] : t[y] = n[y];
}
} else if (c) {
D = {};
for (var S = 0; S < _; S++) {
var y = d[S];
D[y] = Zs(t[y]), GP(t, n, y);
}
}
var x = new oy(t, !1, !1, f ? At(p, function(I) {
return I.targetName === e;
}) : null);
x.targetName = e, a.scope && (x.scope = a.scope), c && T && x.whenWithKeys(0, T, d), D && x.whenWithKeys(0, D, d), x.whenWithKeys(u ?? 500, s ? C : n, d).delay(h || 0), r.addAnimator(x, e), o.push(x);
}
}
var at = function(r) {
Ht(e, r);
function e(t) {
var n = r.call(this) || this;
return n.isGroup = !0, n._children = [], n.attr(t), n;
}
return e.prototype.childrenRef = function() {
return this._children;
}, e.prototype.children = function() {
return this._children.slice();
}, e.prototype.childAt = function(t) {
return this._children[t];
}, e.prototype.childOfName = function(t) {
for (var n = this._children, a = 0; a < n.length; a++)
if (n[a].name === t)
return n[a];
}, e.prototype.childCount = function() {
return this._children.length;
}, e.prototype.add = function(t) {
if (t && (t !== this && t.parent !== this && (this._children.push(t), this._doAdd(t)), process.env.NODE_ENV !== "production" && t.__hostTarget))
throw "This elemenet has been used as an attachment";
return this;
}, e.prototype.addBefore = function(t, n) {
if (t && t !== this && t.parent !== this && n && n.parent === this) {
var a = this._children, i = a.indexOf(n);
i >= 0 && (a.splice(i, 0, t), this._doAdd(t));
}
return this;
}, e.prototype.replace = function(t, n) {
var a = pt(this._children, t);
return a >= 0 && this.replaceAt(n, a), this;
}, e.prototype.replaceAt = function(t, n) {
var a = this._children, i = a[n];
if (t && t !== this && t.parent !== this && t !== i) {
a[n] = t, i.parent = null;
var o = this.__zr;
o && i.removeSelfFromZr(o), this._doAdd(t);
}
return this;
}, e.prototype._doAdd = function(t) {
t.parent && t.parent.remove(t), t.parent = this;
var n = this.__zr;
n && n !== t.__zr && t.addSelfToZr(n), n && n.refresh();
}, e.prototype.remove = function(t) {
var n = this.__zr, a = this._children, i = pt(a, t);
return i < 0 ? this : (a.splice(i, 1), t.parent = null, n && t.removeSelfFromZr(n), n && n.refresh(), this);
}, e.prototype.removeAll = function() {
for (var t = this._children, n = this.__zr, a = 0; a < t.length; a++) {
var i = t[a];
n && i.removeSelfFromZr(n), i.parent = null;
}
return t.length = 0, this;
}, e.prototype.eachChild = function(t, n) {
for (var a = this._children, i = 0; i < a.length; i++) {
var o = a[i];
t.call(n, o, i);
}
return this;
}, e.prototype.traverse = function(t, n) {
for (var a = 0; a < this._children.length; a++) {
var i = this._children[a], o = t.call(n, i);
i.isGroup && !o && i.traverse(t, n);
}
return this;
}, e.prototype.addSelfToZr = function(t) {
r.prototype.addSelfToZr.call(this, t);
for (var n = 0; n < this._children.length; n++) {
var a = this._children[n];
a.addSelfToZr(t);
}
}, e.prototype.removeSelfFromZr = function(t) {
r.prototype.removeSelfFromZr.call(this, t);
for (var n = 0; n < this._children.length; n++) {
var a = this._children[n];
a.removeSelfFromZr(t);
}
}, e.prototype.getBoundingRect = function(t) {
for (var n = new ct(0, 0, 0, 0), a = t || this._children, i = [], o = null, s = 0; s < a.length; s++) {
var l = a[s];
if (!(l.ignore || l.invisible)) {
var u = l.getBoundingRect(), h = l.getLocalTransform(i);
h ? (ct.applyTransform(n, u, h), o = o || n.clone(), o.union(n)) : (o = o || u.clone(), o.union(u));
}
}
return o || n;
}, e;
}(Of);
at.prototype.type = "group";
/*!
* ZRender, a high performance 2d drawing library.
*
* Copyright (c) 2013, Baidu Inc.
* All rights reserved.
*
* LICENSE
* https://github.com/ecomfe/zrender/blob/master/LICENSE.txt
*/
var ks = {}, fC = {};
function WP(r) {
delete fC[r];
}
function $P(r) {
if (!r)
return !1;
if (typeof r == "string")
return kh(r, 1) < dd;
if (r.colorStops) {
for (var e = r.colorStops, t = 0, n = e.length, a = 0; a < n; a++)
t += kh(e[a].color, 1);
return t /= n, t < dd;
}
return !1;
}
var UP = function() {
function r(e, t, n) {
var a = this;
this._sleepAfterStill = 10, this._stillFrameAccum = 0, this._needsRefresh = !0, this._needsRefreshHover = !0, this._darkMode = !1, n = n || {}, this.dom = t, this.id = e;
var i = new aP(), o = n.renderer || "canvas";
if (ks[o] || (o = St(ks)[0]), process.env.NODE_ENV !== "production" && !ks[o])
throw new Error("Renderer '" + o + "' is not imported. Please import it first.");
n.useDirtyRect = n.useDirtyRect == null ? !1 : n.useDirtyRect;
var s = new ks[o](t, i, n, e), l = n.ssr || s.ssrOnly;
this.storage = i, this.painter = s;
var u = !yt.node && !yt.worker && !l ? new RP(s.getViewportRoot(), s.root) : null, h = n.useCoarsePointer, f = h == null || h === "auto" ? yt.touchEventsSupported : !!h, c = 44, v;
f && (v = ot(n.pointerSize, c)), this.handler = new HT(i, s, u, s.root, v), this.animation = new AP({
stage: {
update: l ? null : function() {
return a._flush(!0);
}
}
}), l || this.animation.start();
}
return r.prototype.add = function(e) {
this._disposed || !e || (this.storage.addRoot(e), e.addSelfToZr(this), this.refresh());
}, r.prototype.remove = function(e) {
this._disposed || !e || (this.storage.delRoot(e), e.removeSelfFromZr(this), this.refresh());
}, r.prototype.configLayer = function(e, t) {
this._disposed || (this.painter.configLayer && this.painter.configLayer(e, t), this.refresh());
}, r.prototype.setBackgroundColor = function(e) {
this._disposed || (this.painter.setBackgroundColor && this.painter.setBackgroundColor(e), this.refresh(), this._backgroundColor = e, this._darkMode = $P(e));
}, r.prototype.getBackgroundColor = function() {
return this._backgroundColor;
}, r.prototype.setDarkMode = function(e) {
this._darkMode = e;
}, r.prototype.isDarkMode = function() {
return this._darkMode;
}, r.prototype.refreshImmediately = function(e) {
this._disposed || (e || this.animation.update(!0), this._needsRefresh = !1, this.painter.refresh(), this._needsRefresh = !1);
}, r.prototype.refresh = function() {
this._disposed || (this._needsRefresh = !0, this.animation.start());
}, r.prototype.flush = function() {
this._disposed || this._flush(!1);
}, r.prototype._flush = function(e) {
var t, n = vo();
this._needsRefresh && (t = !0, this.refreshImmediately(e)), this._needsRefreshHover && (t = !0, this.refreshHoverImmediately());
var a = vo();
t ? (this._stillFrameAccum = 0, this.trigger("rendered", {
elapsedTime: a - n
})) : this._sleepAfterStill > 0 && (this._stillFrameAccum++, this._stillFrameAccum > this._sleepAfterStill && this.animation.stop());
}, r.prototype.setSleepAfterStill = function(e) {
this._sleepAfterStill = e;
}, r.prototype.wakeUp = function() {
this._disposed || (this.animation.start(), this._stillFrameAccum = 0);
}, r.prototype.refreshHover = function() {
this._needsRefreshHover = !0;
}, r.prototype.refreshHoverImmediately = function() {
this._disposed || (this._needsRefreshHover = !1, this.painter.refreshHover && this.painter.getType() === "canvas" && this.painter.refreshHover());
}, r.prototype.resize = function(e) {
this._disposed || (e = e || {}, this.painter.resize(e.width, e.height), this.handler.resize());
}, r.prototype.clearAnimation = function() {
this._disposed || this.animation.clear();
}, r.prototype.getWidth = function() {
if (!this._disposed)
return this.painter.getWidth();
}, r.prototype.getHeight = function() {
if (!this._disposed)
return this.painter.getHeight();
}, r.prototype.setCursorStyle = function(e) {
this._disposed || this.handler.setCursorStyle(e);
}, r.prototype.findHover = function(e, t) {
if (!this._disposed)
return this.handler.findHover(e, t);
}, r.prototype.on = function(e, t, n) {
return this._disposed || this.handler.on(e, t, n), this;
}, r.prototype.off = function(e, t) {
this._disposed || this.handler.off(e, t);
}, r.prototype.trigger = function(e, t) {
this._disposed || this.handler.trigger(e, t);
}, r.prototype.clear = function() {
if (!this._disposed) {
for (var e = this.storage.getRoots(), t = 0; t < e.length; t++)
e[t] instanceof at && e[t].removeSelfFromZr(this);
this.storage.delAllRoots(), this.painter.clear();
}
}, r.prototype.dispose = function() {
this._disposed || (this.animation.stop(), this.clear(), this.storage.dispose(), this.painter.dispose(), this.handler.dispose(), this.animation = this.storage = this.painter = this.handler = null, this._disposed = !0, WP(this.id));
}, r;
}();
function z0(r, e) {
var t = new UP(NT(), r, e);
return fC[t.id] = t, t;
}
function YP(r, e) {
ks[r] = e;
}
var md;
function ZP(r) {
if (typeof md == "function")
return md(r);
}
function XP(r) {
md = r;
}
var qP = 1e-4, cC = 20;
function KP(r) {
return r.replace(/^\s+|\s+$/g, "");
}
function Mt(r, e, t, n) {
var a = e[0], i = e[1], o = t[0], s = t[1], l = i - a, u = s - o;
if (l === 0)
return u === 0 ? o : (o + s) / 2;
if (n)
if (l > 0) {
if (r <= a)
return o;
if (r >= i)
return s;
} else {
if (r >= a)
return o;
if (r <= i)
return s;
}
else {
if (r === a)
return o;
if (r === i)
return s;
}
return (r - a) / l * u + o;
}
function W(r, e) {
switch (r) {
case "center":
case "middle":
r = "50%";
break;
case "left":
case "top":
r = "0%";
break;
case "right":
case "bottom":
r = "100%";
break;
}
return U(r) ? KP(r).match(/%$/) ? parseFloat(r) / 100 * e : parseFloat(r) : r == null ? NaN : +r;
}
function jt(r, e, t) {
return e == null && (e = 10), e = Math.min(Math.max(0, e), cC), r = (+r).toFixed(e), t ? r : +r;
}
function yr(r) {
return r.sort(function(e, t) {
return e - t;
}), r;
}
function Kr(r) {
if (r = +r, isNaN(r))
return 0;
if (r > 1e-14) {
for (var e = 1, t = 0; t < 15; t++, e *= 10)
if (Math.round(r * e) / e === r)
return t;
}
return _d(r);
}
function _d(r) {
var e = r.toString().toLowerCase(), t = e.indexOf("e"), n = t > 0 ? +e.slice(t + 1) : 0, a = t > 0 ? t : e.length, i = e.indexOf("."), o = i < 0 ? 0 : a - 1 - i;
return Math.max(0, o - n);
}
function vC(r, e) {
var t = Math.log, n = Math.LN10, a = Math.floor(t(r[1] - r[0]) / n), i = Math.round(t(Math.abs(e[1] - e[0])) / n), o = Math.min(Math.max(-a + i, 0), 20);
return isFinite(o) ? o : 20;
}
function jP(r, e) {
var t = rn(r, function(v, p) {
return v + (isNaN(p) ? 0 : p);
}, 0);
if (t === 0)
return [];
for (var n = Math.pow(10, e), a = G(r, function(v) {
return (isNaN(v) ? 0 : v) / t * n * 100;
}), i = n * 100, o = G(a, function(v) {
return Math.floor(v);
}), s = rn(o, function(v, p) {
return v + p;
}, 0), l = G(a, function(v, p) {
return v - o[p];
}); s < i; ) {
for (var u = Number.NEGATIVE_INFINITY, h = null, f = 0, c = l.length; f < c; ++f)
l[f] > u && (u = l[f], h = f);
++o[h], l[h] = 0, ++s;
}
return G(o, function(v) {
return v / n;
});
}
function QP(r, e) {
var t = Math.max(Kr(r), Kr(e)), n = r + e;
return t > cC ? n : jt(n, t);
}
var G0 = 9007199254740991;
function pC(r) {
var e = Math.PI * 2;
return (r % e + e) % e;
}
function hl(r) {
return r > -1e-4 && r < qP;
}
var JP = /^(?:(\d{4})(?:[-\/](\d{1,2})(?:[-\/](\d{1,2})(?:[T ](\d{1,2})(?::(\d{1,2})(?::(\d{1,2})(?:[.,](\d+))?)?)?(Z|[\+\-]\d\d:?\d\d)?)?)?)?)?$/;
function on(r) {
if (r instanceof Date)
return r;
if (U(r)) {
var e = JP.exec(r);
if (!e)
return /* @__PURE__ */ new Date(NaN);
if (e[8]) {
var t = +e[4] || 0;
return e[8].toUpperCase() !== "Z" && (t -= +e[8].slice(0, 3)), new Date(Date.UTC(+e[1], +(e[2] || 1) - 1, +e[3] || 1, t, +(e[5] || 0), +e[6] || 0, e[7] ? +e[7].substring(0, 3) : 0));
} else
return new Date(+e[1], +(e[2] || 1) - 1, +e[3] || 1, +e[4] || 0, +(e[5] || 0), +e[6] || 0, e[7] ? +e[7].substring(0, 3) : 0);
} else if (r == null)
return /* @__PURE__ */ new Date(NaN);
return new Date(Math.round(r));
}
function tk(r) {
return Math.pow(10, Vf(r));
}
function Vf(r) {
if (r === 0)
return 0;
var e = Math.floor(Math.log(r) / Math.LN10);
return r / Math.pow(10, e) >= 10 && e++, e;
}
function dC(r, e) {
var t = Vf(r), n = Math.pow(10, t), a = r / n, i;
return a < 1.5 ? i = 1 : a < 2.5 ? i = 2 : a < 4 ? i = 3 : a < 7 ? i = 5 : i = 10, r = i * n, t >= -20 ? +r.toFixed(t < 0 ? -t : 0) : r;
}
function Fc(r, e) {
var t = (r.length - 1) * e + 1, n = Math.floor(t), a = +r[n - 1], i = t - n;
return i ? a + i * (r[n] - a) : a;
}
function F0(r) {
r.sort(function(l, u) {
return s(l, u, 0) ? -1 : 1;
});
for (var e = -1 / 0, t = 1, n = 0; n < r.length; ) {
for (var a = r[n].interval, i = r[n].close, o = 0; o < 2; o++)
a[o] <= e && (a[o] = e, i[o] = o ? 1 : 1 - t), e = a[o], t = i[o];
a[0] === a[1] && i[0] * i[1] !== 1 ? r.splice(n, 1) : n++;
}
return r;
function s(l, u, h) {
return l.interval[h] < u.interval[h] || l.interval[h] === u.interval[h] && (l.close[h] - u.close[h] === (h ? -1 : 1) || !h && s(l, u, 1));
}
}
function An(r) {
var e = parseFloat(r);
return e == r && (e !== 0 || !U(r) || r.indexOf("x") <= 0) ? e : NaN;
}
function sy(r) {
return !isNaN(An(r));
}
function gC() {
return Math.round(Math.random() * 9);
}
function yC(r, e) {
return e === 0 ? r : yC(e, r % e);
}
function H0(r, e) {
return r == null ? e : e == null ? r : r * e / yC(r, e);
}
var ek = "[ECharts] ", W0 = {}, rk = typeof console < "u" && console.warn && console.log;
function Bf(r, e, t) {
if (rk) {
if (t) {
if (W0[e])
return;
W0[e] = !0;
}
console[r](ek + e);
}
}
function nk(r, e) {
Bf("log", r, e);
}
function Zt(r, e) {
Bf("warn", r, e);
}
function _e(r, e) {
Bf("error", r, e);
}
function Nr(r) {
process.env.NODE_ENV !== "production" && Bf("warn", "DEPRECATED: " + r, !0);
}
function ee(r, e, t) {
process.env.NODE_ENV !== "production" && Nr((t ? "[" + t + "]" : "") + (r + " is deprecated, use " + e + " instead."));
}
function Be() {
for (var r = [], e = 0; e < arguments.length; e++)
r[e] = arguments[e];
var t = "";
if (process.env.NODE_ENV !== "production") {
var n = function(a) {
return a === void 0 ? "undefined" : a === 1 / 0 ? "Infinity" : a === -1 / 0 ? "-Infinity" : Si(a) ? "NaN" : a instanceof Date ? "Date(" + a.toISOString() + ")" : K(a) ? "function () { ... }" : OT(a) ? a + "" : null;
};
t = G(r, function(a) {
if (U(a))
return a;
var i = n(a);
if (i != null)
return i;
if (typeof JSON < "u" && JSON.stringify)
try {
return JSON.stringify(a, function(o, s) {
var l = n(s);
return l ?? s;
});
} catch {
return "?";
}
else
return "?";
}).join(" ");
}
return t;
}
function Dt(r) {
throw new Error(r);
}
function $0(r, e, t) {
return (e - r) * t + r;
}
var mC = "series\0", _C = "\0_ec_\0";
function Pt(r) {
return r instanceof Array ? r : r == null ? [] : [r];
}
function xi(r, e, t) {
if (r) {
r[e] = r[e] || {}, r.emphasis = r.emphasis || {}, r.emphasis[e] = r.emphasis[e] || {};
for (var n = 0, a = t.length; n < a; n++) {
var i = t[n];
!r.emphasis[e].hasOwnProperty(i) && r[e].hasOwnProperty(i) && (r.emphasis[e][i] = r[e][i]);
}
}
}
var U0 = ["fontStyle", "fontWeight", "fontSize", "fontFamily", "rich", "tag", "color", "textBorderColor", "textBorderWidth", "width", "height", "lineHeight", "align", "verticalAlign", "baseline", "shadowColor", "shadowBlur", "shadowOffsetX", "shadowOffsetY", "textShadowColor", "textShadowBlur", "textShadowOffsetX", "textShadowOffsetY", "backgroundColor", "borderColor", "borderWidth", "borderRadius", "padding"];
function Bo(r) {
return J(r) && !z(r) && !(r instanceof Date) ? r.value : r;
}
function ak(r) {
return J(r) && !(r instanceof Array);
}
function SC(r, e, t) {
var n = t === "normalMerge", a = t === "replaceMerge", i = t === "replaceAll";
r = r || [], e = (e || []).slice();
var o = X();
A(e, function(l, u) {
if (!J(l)) {
e[u] = null;
return;
}
process.env.NODE_ENV !== "production" && (l.id != null && !Z0(l.id) && Y0(l.id), l.name != null && !Z0(l.name) && Y0(l.name));
});
var s = ik(r, o, t);
return (n || a) && ok(s, r, o, e), n && sk(s, e), n || a ? lk(s, e, a) : i && uk(s, e), hk(s), s;
}
function ik(r, e, t) {
var n = [];
if (t === "replaceAll")
return n;
for (var a = 0; a < r.length; a++) {
var i = r[a];
i && i.id != null && e.set(i.id, a), n.push({
existing: t === "replaceMerge" || To(i) ? null : i,
newOption: null,
keyInfo: null,
brandNew: null
});
}
return n;
}
function ok(r, e, t, n) {
A(n, function(a, i) {
if (!(!a || a.id == null)) {
var o = Xs(a.id), s = t.get(o);
if (s != null) {
var l = r[s];
tt(!l.newOption, 'Duplicated option on id "' + o + '".'), l.newOption = a, l.existing = e[s], n[i] = null;
}
}
});
}
function sk(r, e) {
A(e, function(t, n) {
if (!(!t || t.name == null))
for (var a = 0; a < r.length; a++) {
var i = r[a].existing;
if (!r[a].newOption && i && (i.id == null || t.id == null) && !To(t) && !To(i) && xC("name", i, t)) {
r[a].newOption = t, e[n] = null;
return;
}
}
});
}
function lk(r, e, t) {
A(e, function(n) {
if (n) {
for (
var a, i = 0;
// Be `!resultItem` only when `nextIdx >= result.length`.
(a = r[i]) && (a.newOption || To(a.existing) || // In mode "replaceMerge", here no not-mapped-non-internal-existing.
a.existing && n.id != null && !xC("id", n, a.existing));
)
i++;
a ? (a.newOption = n, a.brandNew = t) : r.push({
newOption: n,
brandNew: t,
existing: null,
keyInfo: null
}), i++;
}
});
}
function uk(r, e) {
A(e, function(t) {
r.push({
newOption: t,
brandNew: !0,
existing: null,
keyInfo: null
});
});
}
function hk(r) {
var e = X();
A(r, function(t) {
var n = t.existing;
n && e.set(n.id, t);
}), A(r, function(t) {
var n = t.newOption;
tt(!n || n.id == null || !e.get(n.id) || e.get(n.id) === t, "id duplicates: " + (n && n.id)), n && n.id != null && e.set(n.id, t), !t.keyInfo && (t.keyInfo = {});
}), A(r, function(t, n) {
var a = t.existing, i = t.newOption, o = t.keyInfo;
if (J(i)) {
if (o.name = i.name != null ? Xs(i.name) : a ? a.name : mC + n, a)
o.id = Xs(a.id);
else if (i.id != null)
o.id = Xs(i.id);
else {
var s = 0;
do
o.id = "\0" + o.name + "\0" + s++;
while (e.get(o.id));
}
e.set(o.id, t);
}
});
}
function xC(r, e, t) {
var n = oe(e[r], null), a = oe(t[r], null);
return n != null && a != null && n === a;
}
function Xs(r) {
if (process.env.NODE_ENV !== "production" && r == null)
throw new Error();
return oe(r, "");
}
function oe(r, e) {
return r == null ? e : U(r) ? r : Tt(r) || Mh(r) ? r + "" : e;
}
function Y0(r) {
process.env.NODE_ENV !== "production" && Zt("`" + r + "` is invalid id or name. Must be a string or number.");
}
function Z0(r) {
return Mh(r) || sy(r);
}
function ly(r) {
var e = r.name;
return !!(e && e.indexOf(mC));
}
function To(r) {
return r && r.id != null && Xs(r.id).indexOf(_C) === 0;
}
function fk(r) {
return _C + r;
}
function ck(r, e, t) {
A(r, function(n) {
var a = n.newOption;
J(a) && (n.keyInfo.mainType = e, n.keyInfo.subType = vk(e, a, n.existing, t));
});
}
function vk(r, e, t, n) {
var a = e.type ? e.type : t ? t.subType : n.determineSubType(r, e);
return a;
}
function pk(r, e) {
var t = {}, n = {};
return a(r || [], t), a(e || [], n, t), [i(t), i(n)];
function a(o, s, l) {
for (var u = 0, h = o.length; u < h; u++) {
var f = oe(o[u].seriesId, null);
if (f == null)
return;
for (var c = Pt(o[u].dataIndex), v = l && l[f], p = 0, d = c.length; p < d; p++) {
var g = c[p];
v && v[g] ? v[g] = null : (s[f] || (s[f] = {}))[g] = 1;
}
}
}
function i(o, s) {
var l = [];
for (var u in o)
if (o.hasOwnProperty(u) && o[u] != null)
if (s)
l.push(+u);
else {
var h = i(o[u], !0);
h.length && l.push({
seriesId: u,
dataIndex: h
});
}
return l;
}
}
function bi(r, e) {
if (e.dataIndexInside != null)
return e.dataIndexInside;
if (e.dataIndex != null)
return z(e.dataIndex) ? G(e.dataIndex, function(t) {
return r.indexOfRawIndex(t);
}) : r.indexOfRawIndex(e.dataIndex);
if (e.name != null)
return z(e.name) ? G(e.name, function(t) {
return r.indexOfName(t);
}) : r.indexOfName(e.name);
}
function bt() {
var r = "__ec_inner_" + dk++;
return function(e) {
return e[r] || (e[r] = {});
};
}
var dk = gC();
function qs(r, e, t) {
var n = uy(e, t), a = n.mainTypeSpecified, i = n.queryOptionMap, o = n.others, s = o, l = t ? t.defaultMainType : null;
return !a && l && i.set(l, {}), i.each(function(u, h) {
var f = Ol(r, h, u, {
useDefault: l === h,
enableAll: t && t.enableAll != null ? t.enableAll : !0,
enableNone: t && t.enableNone != null ? t.enableNone : !0
});
s[h + "Models"] = f.models, s[h + "Model"] = f.models[0];
}), s;
}
function uy(r, e) {
var t;
if (U(r)) {
var n = {};
n[r + "Index"] = 0, t = n;
} else
t = r;
var a = X(), i = {}, o = !1;
return A(t, function(s, l) {
if (l === "dataIndex" || l === "dataIndexInside") {
i[l] = s;
return;
}
var u = l.match(/^(\w+)(Index|Id|Name)$/) || [], h = u[1], f = (u[2] || "").toLowerCase();
if (!(!h || !f || e && e.includeMainTypes && pt(e.includeMainTypes, h) < 0)) {
o = o || !!h;
var c = a.get(h) || a.set(h, {});
c[f] = s;
}
}), {
mainTypeSpecified: o,
queryOptionMap: a,
others: i
};
}
var ne = {
useDefault: !0,
enableAll: !1,
enableNone: !1
}, gk = {
useDefault: !1,
enableAll: !0,
enableNone: !0
};
function Ol(r, e, t, n) {
n = n || ne;
var a = t.index, i = t.id, o = t.name, s = {
models: null,
specified: a != null || i != null || o != null
};
if (!s.specified) {
var l = void 0;
return s.models = n.useDefault && (l = r.getComponent(e)) ? [l] : [], s;
}
return a === "none" || a === !1 ? (tt(n.enableNone, '`"none"` or `false` is not a valid value on index option.'), s.models = [], s) : (a === "all" && (tt(n.enableAll, '`"all"` is not a valid value on index option.'), a = i = o = null), s.models = r.queryComponents({
mainType: e,
index: a,
id: i,
name: o
}), s);
}
function bC(r, e, t) {
r.setAttribute ? r.setAttribute(e, t) : r[e] = t;
}
function yk(r, e) {
return r.getAttribute ? r.getAttribute(e) : r[e];
}
function mk(r) {
return r === "auto" ? yt.domSupported ? "html" : "richText" : r || "html";
}
function Sd(r, e) {
var t = X(), n = [];
return A(r, function(a) {
var i = e(a);
(t.get(i) || (n.push(i), t.set(i, []))).push(a);
}), {
keys: n,
buckets: t
};
}
function wC(r, e, t, n, a) {
var i = e == null || e === "auto";
if (n == null)
return n;
if (Tt(n)) {
var o = $0(t || 0, n, a);
return jt(o, i ? Math.max(Kr(t || 0), Kr(n)) : e);
} else {
if (U(n))
return a < 1 ? t : n;
for (var s = [], l = t, u = n, h = Math.max(l ? l.length : 0, u.length), f = 0; f < h; ++f) {
var c = r.getDimensionInfo(f);
if (c && c.type === "ordinal")
s[f] = (a < 1 && l ? l : u)[f];
else {
var v = l && l[f] ? l[f] : 0, p = u[f], o = $0(v, p, a);
s[f] = jt(o, i ? Math.max(Kr(v), Kr(p)) : e);
}
}
return s;
}
}
var _k = ".", Aa = "___EC__COMPONENT__CONTAINER___", TC = "___EC__EXTENDED_CLASS___";
function jr(r) {
var e = {
main: "",
sub: ""
};
if (r) {
var t = r.split(_k);
e.main = t[0] || "", e.sub = t[1] || "";
}
return e;
}
function Sk(r) {
tt(/^[a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)?$/.test(r), 'componentType "' + r + '" illegal');
}
function xk(r) {
return !!(r && r[TC]);
}
function hy(r, e) {
r.$constructor = r, r.extend = function(t) {
process.env.NODE_ENV !== "production" && A(e, function(i) {
t[i] || console.warn("Method `" + i + "` should be implemented" + (t.type ? " in " + t.type : "") + ".");
});
var n = this, a;
return bk(n) ? a = /** @class */
function(i) {
O(o, i);
function o() {
return i.apply(this, arguments) || this;
}
return o;
}(n) : (a = function() {
(t.$constructor || n).apply(this, arguments);
}, DE(a, this)), B(a.prototype, t), a[TC] = !0, a.extend = this.extend, a.superCall = Ck, a.superApply = Dk, a.superClass = n, a;
};
}
function bk(r) {
return K(r) && /^class\s/.test(Function.prototype.toString.call(r));
}
function CC(r, e) {
r.extend = e.extend;
}
var wk = Math.round(Math.random() * 10);
function Tk(r) {
var e = ["__\0is_clz", wk++].join("_");
r.prototype[e] = !0, process.env.NODE_ENV !== "production" && tt(!r.isInstance, 'The method "is" can not be defined.'), r.isInstance = function(t) {
return !!(t && t[e]);
};
}
function Ck(r, e) {
for (var t = [], n = 2; n < arguments.length; n++)
t[n - 2] = arguments[n];
return this.superClass.prototype[e].apply(r, t);
}
function Dk(r, e, t) {
return this.superClass.prototype[e].apply(r, t);
}
function zf(r) {
var e = {};
r.registerClass = function(n) {
var a = n.type || n.prototype.type;
if (a) {
Sk(a), n.prototype.type = a;
var i = jr(a);
if (!i.sub)
process.env.NODE_ENV !== "production" && e[i.main] && console.warn(i.main + " exists."), e[i.main] = n;
else if (i.sub !== Aa) {
var o = t(i);
o[i.sub] = n;
}
}
return n;
}, r.getClass = function(n, a, i) {
var o = e[n];
if (o && o[Aa] && (o = a ? o[a] : null), i && !o)
throw new Error(a ? "Component " + n + "." + (a || "") + " is used but not imported." : n + ".type should be specified.");
return o;
}, r.getClassesByMainType = function(n) {
var a = jr(n), i = [], o = e[a.main];
return o && o[Aa] ? A(o, function(s, l) {
l !== Aa && i.push(s);
}) : i.push(o), i;
}, r.hasClass = function(n) {
var a = jr(n);
return !!e[a.main];
}, r.getAllClassMainTypes = function() {
var n = [];
return A(e, function(a, i) {
n.push(i);
}), n;
}, r.hasSubTypes = function(n) {
var a = jr(n), i = e[a.main];
return i && i[Aa];
};
function t(n) {
var a = e[n.main];
return (!a || !a[Aa]) && (a = e[n.main] = {}, a[Aa] = !0), a;
}
}
function wi(r, e) {
for (var t = 0; t < r.length; t++)
r[t][1] || (r[t][1] = r[t][0]);
return e = e || !1, function(n, a, i) {
for (var o = {}, s = 0; s < r.length; s++) {
var l = r[s][1];
if (!(a && pt(a, l) >= 0 || i && pt(i, l) < 0)) {
var u = n.getShallow(l, e);
u != null && (o[r[s][0]] = u);
}
}
return o;
};
}
var Ak = [
["fill", "color"],
["shadowBlur"],
["shadowOffsetX"],
["shadowOffsetY"],
["opacity"],
["shadowColor"]
// Option decal is in `DecalObject` but style.decal is in `PatternObject`.
// So do not transfer decal directly.
], Mk = wi(Ak), Ik = (
/** @class */
function() {
function r() {
}
return r.prototype.getAreaStyle = function(e, t) {
return Mk(this, e, t);
}, r;
}()
), xd = new Rl(50);
function Lk(r) {
if (typeof r == "string") {
var e = xd.get(r);
return e && e.image;
} else
return r;
}
function fy(r, e, t, n, a) {
if (r)
if (typeof r == "string") {
if (e && e.__zrImageSrc === r || !t)
return e;
var i = xd.get(r), o = { hostEl: t, cb: n, cbPayload: a };
return i ? (e = i.image, !Gf(e) && i.pending.push(o)) : (e = ha.loadImage(r, X0, X0), e.__zrImageSrc = r, xd.put(r, e.__cachedImgObj = {
image: e,
pending: [o]
})), e;
} else
return r;
else return e;
}
function X0() {
var r = this.__cachedImgObj;
this.onload = this.onerror = this.__cachedImgObj = null;
for (var e = 0; e < r.pending.length; e++) {
var t = r.pending[e], n = t.cb;
n && n(this, t.cbPayload), t.hostEl.dirty();
}
r.pending.length = 0;
}
function Gf(r) {
return r && r.width && r.height;
}
var Hc = /\{([a-zA-Z0-9_]+)\|([^}]*)\}/g;
function Ek(r, e, t, n, a, i) {
if (!t) {
r.text = "", r.isTruncated = !1;
return;
}
var o = (e + "").split(`
`);
i = DC(t, n, a, i);
for (var s = !1, l = {}, u = 0, h = o.length; u < h; u++)
AC(l, o[u], i), o[u] = l.textLine, s = s || l.isTruncated;
r.text = o.join(`
`), r.isTruncated = s;
}
function DC(r, e, t, n) {
n = n || {};
var a = B({}, n);
a.font = e, t = ot(t, "..."), a.maxIterations = ot(n.maxIterations, 2);
var i = a.minChar = ot(n.minChar, 0);
a.cnCharWidth = rr("国", e);
var o = a.ascCharWidth = rr("a", e);
a.placeholder = ot(n.placeholder, "");
for (var s = r = Math.max(0, r - 1), l = 0; l < i && s >= o; l++)
s -= o;
var u = rr(t, e);
return u > s && (t = "", u = 0), s = r - u, a.ellipsis = t, a.ellipsisWidth = u, a.contentWidth = s, a.containerWidth = r, a;
}
function AC(r, e, t) {
var n = t.containerWidth, a = t.font, i = t.contentWidth;
if (!n) {
r.textLine = "", r.isTruncated = !1;
return;
}
var o = rr(e, a);
if (o <= n) {
r.textLine = e, r.isTruncated = !1;
return;
}
for (var s = 0; ; s++) {
if (o <= i || s >= t.maxIterations) {
e += t.ellipsis;
break;
}
var l = s === 0 ? Pk(e, i, t.ascCharWidth, t.cnCharWidth) : o > 0 ? Math.floor(e.length * i / o) : 0;
e = e.substr(0, l), o = rr(e, a);
}
e === "" && (e = t.placeholder), r.textLine = e, r.isTruncated = !0;
}
function Pk(r, e, t, n) {
for (var a = 0, i = 0, o = r.length; i < o && a < e; i++) {
var s = r.charCodeAt(i);
a += 0 <= s && s <= 127 ? t : n;
}
return i;
}
function kk(r, e) {
r != null && (r += "");
var t = e.overflow, n = e.padding, a = e.font, i = t === "truncate", o = Nf(a), s = ot(e.lineHeight, o), l = !!e.backgroundColor, u = e.lineOverflow === "truncate", h = !1, f = e.width, c;
f != null && (t === "break" || t === "breakAll") ? c = r ? MC(r, e.font, f, t === "breakAll", 0).lines : [] : c = r ? r.split(`
`) : [];
var v = c.length * s, p = ot(e.height, v);
if (v > p && u) {
var d = Math.floor(p / s);
h = h || c.length > d, c = c.slice(0, d);
}
if (r && i && f != null)
for (var g = DC(f, a, e.ellipsis, {
minChar: e.truncateMinChar,
placeholder: e.placeholder
}), y = {}, m = 0; m < c.length; m++)
AC(y, c[m], g), c[m] = y.textLine, h = h || y.isTruncated;
for (var _ = p, S = 0, m = 0; m < c.length; m++)
S = Math.max(rr(c[m], a), S);
f == null && (f = S);
var x = S;
return n && (_ += n[0] + n[2], x += n[1] + n[3], f += n[1] + n[3]), l && (x = f), {
lines: c,
height: p,
outerWidth: x,
outerHeight: _,
lineHeight: s,
calculatedLineHeight: o,
contentWidth: S,
contentHeight: v,
width: f,
isTruncated: h
};
}
var Rk = /* @__PURE__ */ function() {
function r() {
}
return r;
}(), q0 = /* @__PURE__ */ function() {
function r(e) {
this.tokens = [], e && (this.tokens = e);
}
return r;
}(), Nk = /* @__PURE__ */ function() {
function r() {
this.width = 0, this.height = 0, this.contentWidth = 0, this.contentHeight = 0, this.outerWidth = 0, this.outerHeight = 0, this.lines = [], this.isTruncated = !1;
}
return r;
}();
function Ok(r, e) {
var t = new Nk();
if (r != null && (r += ""), !r)
return t;
for (var n = e.width, a = e.height, i = e.overflow, o = (i === "break" || i === "breakAll") && n != null ? { width: n, accumWidth: 0, breakAll: i === "breakAll" } : null, s = Hc.lastIndex = 0, l; (l = Hc.exec(r)) != null; ) {
var u = l.index;
u > s && Wc(t, r.substring(s, u), e, o), Wc(t, l[2], e, o, l[1]), s = Hc.lastIndex;
}
s < r.length && Wc(t, r.substring(s, r.length), e, o);
var h = [], f = 0, c = 0, v = e.padding, p = i === "truncate", d = e.lineOverflow === "truncate", g = {};
function y(F, H, $) {
F.width = H, F.lineHeight = $, f += $, c = Math.max(c, H);
}
t: for (var m = 0; m < t.lines.length; m++) {
for (var _ = t.lines[m], S = 0, x = 0, b = 0; b < _.tokens.length; b++) {
var w = _.tokens[b], T = w.styleName && e.rich[w.styleName] || {}, C = w.textPadding = T.padding, D = C ? C[1] + C[3] : 0, M = w.font = T.font || e.font;
w.contentHeight = Nf(M);
var I = ot(T.height, w.contentHeight);
if (w.innerHeight = I, C && (I += C[0] + C[2]), w.height = I, w.lineHeight = mr(T.lineHeight, e.lineHeight, I), w.align = T && T.align || e.align, w.verticalAlign = T && T.verticalAlign || "middle", d && a != null && f + w.lineHeight > a) {
var L = t.lines.length;
b > 0 ? (_.tokens = _.tokens.slice(0, b), y(_, x, S), t.lines = t.lines.slice(0, m + 1)) : t.lines = t.lines.slice(0, m), t.isTruncated = t.isTruncated || t.lines.length < L;
break t;
}
var E = T.width, P = E == null || E === "auto";
if (typeof E == "string" && E.charAt(E.length - 1) === "%")
w.percentWidth = E, h.push(w), w.contentWidth = rr(w.text, M);
else {
if (P) {
var k = T.backgroundColor, N = k && k.image;
N && (N = Lk(N), Gf(N) && (w.width = Math.max(w.width, N.width * I / N.height)));
}
var R = p && n != null ? n - x : null;
R != null && R < w.width ? !P || R < D ? (w.text = "", w.width = w.contentWidth = 0) : (Ek(g, w.text, R - D, M, e.ellipsis, { minChar: e.truncateMinChar }), w.text = g.text, t.isTruncated = t.isTruncated || g.isTruncated, w.width = w.contentWidth = rr(w.text, M)) : w.contentWidth = rr(w.text, M);
}
w.width += D, x += w.width, T && (S = Math.max(S, w.lineHeight));
}
y(_, x, S);
}
t.outerWidth = t.width = ot(n, c), t.outerHeight = t.height = ot(a, f), t.contentHeight = f, t.contentWidth = c, v && (t.outerWidth += v[1] + v[3], t.outerHeight += v[0] + v[2]);
for (var m = 0; m < h.length; m++) {
var w = h[m], V = w.percentWidth;
w.width = parseInt(V, 10) / 100 * t.width;
}
return t;
}
function Wc(r, e, t, n, a) {
var i = e === "", o = a && t.rich[a] || {}, s = r.lines, l = o.font || t.font, u = !1, h, f;
if (n) {
var c = o.padding, v = c ? c[1] + c[3] : 0;
if (o.width != null && o.width !== "auto") {
var p = Rr(o.width, n.width) + v;
s.length > 0 && p + n.accumWidth > n.width && (h = e.split(`
`), u = !0), n.accumWidth = p;
} else {
var d = MC(e, l, n.width, n.breakAll, n.accumWidth);
n.accumWidth = d.accumWidth + v, f = d.linesWidths, h = d.lines;
}
} else
h = e.split(`
`);
for (var g = 0; g < h.length; g++) {
var y = h[g], m = new Rk();
if (m.styleName = a, m.text = y, m.isLineHolder = !y && !i, typeof o.width == "number" ? m.width = o.width : m.width = f ? f[g] : rr(y, l), !g && !u) {
var _ = (s[s.length - 1] || (s[0] = new q0())).tokens, S = _.length;
S === 1 && _[0].isLineHolder ? _[0] = m : (y || !S || i) && _.push(m);
} else
s.push(new q0([m]));
}
}
function Vk(r) {
var e = r.charCodeAt(0);
return e >= 32 && e <= 591 || e >= 880 && e <= 4351 || e >= 4608 && e <= 5119 || e >= 7680 && e <= 8303;
}
var Bk = rn(",&?/;] ".split(""), function(r, e) {
return r[e] = !0, r;
}, {});
function zk(r) {
return Vk(r) ? !!Bk[r] : !0;
}
function MC(r, e, t, n, a) {
for (var i = [], o = [], s = "", l = "", u = 0, h = 0, f = 0; f < r.length; f++) {
var c = r.charAt(f);
if (c === `
`) {
l && (s += l, h += u), i.push(s), o.push(h), s = "", l = "", u = 0, h = 0;
continue;
}
var v = rr(c, e), p = n ? !1 : !zk(c);
if (i.length ? h + v > t : a + h + v > t) {
h ? (s || l) && (p ? (s || (s = l, l = "", u = 0, h = u), i.push(s), o.push(h - u), l += c, u += v, s = "", h = u) : (l && (s += l, l = "", u = 0), i.push(s), o.push(h), s = c, h = v)) : p ? (i.push(l), o.push(u), l = c, u = v) : (i.push(c), o.push(v));
continue;
}
h += v, p ? (l += c, u += v) : (l && (s += l, l = "", u = 0), s += c);
}
return !i.length && !s && (s = r, l = "", u = 0), l && (s += l), s && (i.push(s), o.push(h)), i.length === 1 && (h += a), {
accumWidth: h,
lines: i,
linesWidths: o
};
}
var bd = "__zr_style_" + Math.round(Math.random() * 10), fi = {
shadowBlur: 0,
shadowOffsetX: 0,
shadowOffsetY: 0,
shadowColor: "#000",
opacity: 1,
blend: "source-over"
}, Ff = {
style: {
shadowBlur: !0,
shadowOffsetX: !0,
shadowOffsetY: !0,
shadowColor: !0,
opacity: !0
}
};
fi[bd] = !0;
var K0 = ["z", "z2", "invisible"], Gk = ["invisible"], Sr = function(r) {
Ht(e, r);
function e(t) {
return r.call(this, t) || this;
}
return e.prototype._init = function(t) {
for (var n = St(t), a = 0; a < n.length; a++) {
var i = n[a];
i === "style" ? this.useStyle(t[i]) : r.prototype.attrKV.call(this, i, t[i]);
}
this.style || this.useStyle({});
}, e.prototype.beforeBrush = function() {
}, e.prototype.afterBrush = function() {
}, e.prototype.innerBeforeBrush = function() {
}, e.prototype.innerAfterBrush = function() {
}, e.prototype.shouldBePainted = function(t, n, a, i) {
var o = this.transform;
if (this.ignore || this.invisible || this.style.opacity === 0 || this.culling && Fk(this, t, n) || o && !o[0] && !o[3])
return !1;
if (a && this.__clipPaths) {
for (var s = 0; s < this.__clipPaths.length; ++s)
if (this.__clipPaths[s].isZeroArea())
return !1;
}
if (i && this.parent)
for (var l = this.parent; l; ) {
if (l.ignore)
return !1;
l = l.parent;
}
return !0;
}, e.prototype.contain = function(t, n) {
return this.rectContain(t, n);
}, e.prototype.traverse = function(t, n) {
t.call(n, this);
}, e.prototype.rectContain = function(t, n) {
var a = this.transformCoordToLocal(t, n), i = this.getBoundingRect();
return i.contain(a[0], a[1]);
}, e.prototype.getPaintRect = function() {
var t = this._paintRect;
if (!this._paintRect || this.__dirty) {
var n = this.transform, a = this.getBoundingRect(), i = this.style, o = i.shadowBlur || 0, s = i.shadowOffsetX || 0, l = i.shadowOffsetY || 0;
t = this._paintRect || (this._paintRect = new ct(0, 0, 0, 0)), n ? ct.applyTransform(t, a, n) : t.copy(a), (o || s || l) && (t.width += o * 2 + Math.abs(s), t.height += o * 2 + Math.abs(l), t.x = Math.min(t.x, t.x + s - o), t.y = Math.min(t.y, t.y + l - o));
var u = this.dirtyRectTolerance;
t.isZero() || (t.x = Math.floor(t.x - u), t.y = Math.floor(t.y - u), t.width = Math.ceil(t.width + 1 + u * 2), t.height = Math.ceil(t.height + 1 + u * 2));
}
return t;
}, e.prototype.setPrevPaintRect = function(t) {
t ? (this._prevPaintRect = this._prevPaintRect || new ct(0, 0, 0, 0), this._prevPaintRect.copy(t)) : this._prevPaintRect = null;
}, e.prototype.getPrevPaintRect = function() {
return this._prevPaintRect;
}, e.prototype.animateStyle = function(t) {
return this.animate("style", t);
}, e.prototype.updateDuringAnimation = function(t) {
t === "style" ? this.dirtyStyle() : this.markRedraw();
}, e.prototype.attrKV = function(t, n) {
t !== "style" ? r.prototype.attrKV.call(this, t, n) : this.style ? this.setStyle(n) : this.useStyle(n);
}, e.prototype.setStyle = function(t, n) {
return typeof t == "string" ? this.style[t] = n : B(this.style, t), this.dirtyStyle(), this;
}, e.prototype.dirtyStyle = function(t) {
t || this.markRedraw(), this.__dirty |= lh, this._rect && (this._rect = null);
}, e.prototype.dirty = function() {
this.dirtyStyle();
}, e.prototype.styleChanged = function() {
return !!(this.__dirty & lh);
}, e.prototype.styleUpdated = function() {
this.__dirty &= -3;
}, e.prototype.createStyle = function(t) {
return Pf(fi, t);
}, e.prototype.useStyle = function(t) {
t[bd] || (t = this.createStyle(t)), this.__inHover ? this.__hoverStyle = t : this.style = t, this.dirtyStyle();
}, e.prototype.isStyleObject = function(t) {
return t[bd];
}, e.prototype._innerSaveToNormal = function(t) {
r.prototype._innerSaveToNormal.call(this, t);
var n = this._normalState;
t.style && !n.style && (n.style = this._mergeStyle(this.createStyle(), this.style)), this._savePrimaryToNormal(t, n, K0);
}, e.prototype._applyStateObj = function(t, n, a, i, o, s) {
r.prototype._applyStateObj.call(this, t, n, a, i, o, s);
var l = !(n && i), u;
if (n && n.style ? o ? i ? u = n.style : (u = this._mergeStyle(this.createStyle(), a.style), this._mergeStyle(u, n.style)) : (u = this._mergeStyle(this.createStyle(), i ? this.style : a.style), this._mergeStyle(u, n.style)) : l && (u = a.style), u)
if (o) {
var h = this.style;
if (this.style = this.createStyle(l ? {} : h), l)
for (var f = St(h), c = 0; c < f.length; c++) {
var v = f[c];
v in u && (u[v] = u[v], this.style[v] = h[v]);
}
for (var p = St(u), c = 0; c < p.length; c++) {
var v = p[c];
this.style[v] = this.style[v];
}
this._transitionState(t, {
style: u
}, s, this.getAnimationStyleProps());
} else
this.useStyle(u);
for (var d = this.__inHover ? Gk : K0, c = 0; c < d.length; c++) {
var v = d[c];
n && n[v] != null ? this[v] = n[v] : l && a[v] != null && (this[v] = a[v]);
}
}, e.prototype._mergeStates = function(t) {
for (var n = r.prototype._mergeStates.call(this, t), a, i = 0; i < t.length; i++) {
var o = t[i];
o.style && (a = a || {}, this._mergeStyle(a, o.style));
}
return a && (n.style = a), n;
}, e.prototype._mergeStyle = function(t, n) {
return B(t, n), t;
}, e.prototype.getAnimationStyleProps = function() {
return Ff;
}, e.initDefaultProps = function() {
var t = e.prototype;
t.type = "displayable", t.invisible = !1, t.z = 0, t.z2 = 0, t.zlevel = 0, t.culling = !1, t.cursor = "pointer", t.rectHover = !1, t.incremental = !1, t._rect = null, t.dirtyRectTolerance = 0, t.__dirty = tn | lh;
}(), e;
}(Of), $c = new ct(0, 0, 0, 0), Uc = new ct(0, 0, 0, 0);
function Fk(r, e, t) {
return $c.copy(r.getBoundingRect()), r.transform && $c.applyTransform(r.transform), Uc.width = e, Uc.height = t, !$c.intersect(Uc);
}
var Ze = Math.min, Xe = Math.max, Yc = Math.sin, Zc = Math.cos, Ma = Math.PI * 2, cu = Ii(), vu = Ii(), pu = Ii();
function Hf(r, e, t) {
if (r.length !== 0) {
for (var n = r[0], a = n[0], i = n[0], o = n[1], s = n[1], l = 1; l < r.length; l++)
n = r[l], a = Ze(a, n[0]), i = Xe(i, n[0]), o = Ze(o, n[1]), s = Xe(s, n[1]);
e[0] = a, e[1] = o, t[0] = i, t[1] = s;
}
}
function j0(r, e, t, n, a, i) {
a[0] = Ze(r, t), a[1] = Ze(e, n), i[0] = Xe(r, t), i[1] = Xe(e, n);
}
var Q0 = [], J0 = [];
function Hk(r, e, t, n, a, i, o, s, l, u) {
var h = XT, f = ue, c = h(r, t, a, o, Q0);
l[0] = 1 / 0, l[1] = 1 / 0, u[0] = -1 / 0, u[1] = -1 / 0;
for (var v = 0; v < c; v++) {
var p = f(r, t, a, o, Q0[v]);
l[0] = Ze(p, l[0]), u[0] = Xe(p, u[0]);
}
c = h(e, n, i, s, J0);
for (var v = 0; v < c; v++) {
var d = f(e, n, i, s, J0[v]);
l[1] = Ze(d, l[1]), u[1] = Xe(d, u[1]);
}
l[0] = Ze(r, l[0]), u[0] = Xe(r, u[0]), l[0] = Ze(o, l[0]), u[0] = Xe(o, u[0]), l[1] = Ze(e, l[1]), u[1] = Xe(e, u[1]), l[1] = Ze(s, l[1]), u[1] = Xe(s, u[1]);
}
function Wk(r, e, t, n, a, i, o, s) {
var l = KT, u = de, h = Xe(Ze(l(r, t, a), 1), 0), f = Xe(Ze(l(e, n, i), 1), 0), c = u(r, t, a, h), v = u(e, n, i, f);
o[0] = Ze(r, a, c), o[1] = Ze(e, i, v), s[0] = Xe(r, a, c), s[1] = Xe(e, i, v);
}
function $k(r, e, t, n, a, i, o, s, l) {
var u = Qn, h = Jn, f = Math.abs(a - i);
if (f % Ma < 1e-4 && f > 1e-4) {
s[0] = r - t, s[1] = e - n, l[0] = r + t, l[1] = e + n;
return;
}
if (cu[0] = Zc(a) * t + r, cu[1] = Yc(a) * n + e, vu[0] = Zc(i) * t + r, vu[1] = Yc(i) * n + e, u(s, cu, vu), h(l, cu, vu), a = a % Ma, a < 0 && (a = a + Ma), i = i % Ma, i < 0 && (i = i + Ma), a > i && !o ? i += Ma : a < i && o && (a += Ma), o) {
var c = i;
i = a, a = c;
}
for (var v = 0; v < i; v += Math.PI / 2)
v > a && (pu[0] = Zc(v) * t + r, pu[1] = Yc(v) * n + e, u(s, pu, s), h(l, pu, l));
}
var Nt = {
M: 1,
L: 2,
C: 3,
Q: 4,
A: 5,
Z: 6,
R: 7
}, Ia = [], La = [], zr = [], Bn = [], Gr = [], Fr = [], Xc = Math.min, qc = Math.max, Ea = Math.cos, Pa = Math.sin, fn = Math.abs, wd = Math.PI, Zn = wd * 2, Kc = typeof Float32Array < "u", os = [];
function jc(r) {
var e = Math.round(r / wd * 1e8) / 1e8;
return e % 2 * wd;
}
function cy(r, e) {
var t = jc(r[0]);
t < 0 && (t += Zn);
var n = t - r[0], a = r[1];
a += n, !e && a - t >= Zn ? a = t + Zn : e && t - a >= Zn ? a = t - Zn : !e && t > a ? a = t + (Zn - jc(t - a)) : e && t < a && (a = t - (Zn - jc(a - t))), r[0] = t, r[1] = a;
}
var sn = function() {
function r(e) {
this.dpr = 1, this._xi = 0, this._yi = 0, this._x0 = 0, this._y0 = 0, this._len = 0, e && (this._saveData = !1), this._saveData && (this.data = []);
}
return r.prototype.increaseVersion = function() {
this._version++;
}, r.prototype.getVersion = function() {
return this._version;
}, r.prototype.setScale = function(e, t, n) {
n = n || 0, n > 0 && (this._ux = fn(n / Nh / e) || 0, this._uy = fn(n / Nh / t) || 0);
}, r.prototype.setDPR = function(e) {
this.dpr = e;
}, r.prototype.setContext = function(e) {
this._ctx = e;
}, r.prototype.getContext = function() {
return this._ctx;
}, r.prototype.beginPath = function() {
return this._ctx && this._ctx.beginPath(), this.reset(), this;
}, r.prototype.reset = function() {
this._saveData && (this._len = 0), this._pathSegLen && (this._pathSegLen = null, this._pathLen = 0), this._version++;
}, r.prototype.moveTo = function(e, t) {
return this._drawPendingPt(), this.addData(Nt.M, e, t), this._ctx && this._ctx.moveTo(e, t), this._x0 = e, this._y0 = t, this._xi = e, this._yi = t, this;
}, r.prototype.lineTo = function(e, t) {
var n = fn(e - this._xi), a = fn(t - this._yi), i = n > this._ux || a > this._uy;
if (this.addData(Nt.L, e, t), this._ctx && i && this._ctx.lineTo(e, t), i)
this._xi = e, this._yi = t, this._pendingPtDist = 0;
else {
var o = n * n + a * a;
o > this._pendingPtDist && (this._pendingPtX = e, this._pendingPtY = t, this._pendingPtDist = o);
}
return this;
}, r.prototype.bezierCurveTo = function(e, t, n, a, i, o) {
return this._drawPendingPt(), this.addData(Nt.C, e, t, n, a, i, o), this._ctx && this._ctx.bezierCurveTo(e, t, n, a, i, o), this._xi = i, this._yi = o, this;
}, r.prototype.quadraticCurveTo = function(e, t, n, a) {
return this._drawPendingPt(), this.addData(Nt.Q, e, t, n, a), this._ctx && this._ctx.quadraticCurveTo(e, t, n, a), this._xi = n, this._yi = a, this;
}, r.prototype.arc = function(e, t, n, a, i, o) {
this._drawPendingPt(), os[0] = a, os[1] = i, cy(os, o), a = os[0], i = os[1];
var s = i - a;
return this.addData(Nt.A, e, t, n, n, a, s, 0, o ? 0 : 1), this._ctx && this._ctx.arc(e, t, n, a, i, o), this._xi = Ea(i) * n + e, this._yi = Pa(i) * n + t, this;
}, r.prototype.arcTo = function(e, t, n, a, i) {
return this._drawPendingPt(), this._ctx && this._ctx.arcTo(e, t, n, a, i), this;
}, r.prototype.rect = function(e, t, n, a) {
return this._drawPendingPt(), this._ctx && this._ctx.rect(e, t, n, a), this.addData(Nt.R, e, t, n, a), this;
}, r.prototype.closePath = function() {
this._drawPendingPt(), this.addData(Nt.Z);
var e = this._ctx, t = this._x0, n = this._y0;
return e && e.closePath(), this._xi = t, this._yi = n, this;
}, r.prototype.fill = function(e) {
e && e.fill(), this.toStatic();
}, r.prototype.stroke = function(e) {
e && e.stroke(), this.toStatic();
}, r.prototype.len = function() {
return this._len;
}, r.prototype.setData = function(e) {
var t = e.length;
!(this.data && this.data.length === t) && Kc && (this.data = new Float32Array(t));
for (var n = 0; n < t; n++)
this.data[n] = e[n];
this._len = t;
}, r.prototype.appendPath = function(e) {
e instanceof Array || (e = [e]);
for (var t = e.length, n = 0, a = this._len, i = 0; i < t; i++)
n += e[i].len();
Kc && this.data instanceof Float32Array && (this.data = new Float32Array(a + n));
for (var i = 0; i < t; i++)
for (var o = e[i].data, s = 0; s < o.length; s++)
this.data[a++] = o[s];
this._len = a;
}, r.prototype.addData = function(e, t, n, a, i, o, s, l, u) {
if (this._saveData) {
var h = this.data;
this._len + arguments.length > h.length && (this._expandData(), h = this.data);
for (var f = 0; f < arguments.length; f++)
h[this._len++] = arguments[f];
}
}, r.prototype._drawPendingPt = function() {
this._pendingPtDist > 0 && (this._ctx && this._ctx.lineTo(this._pendingPtX, this._pendingPtY), this._pendingPtDist = 0);
}, r.prototype._expandData = function() {
if (!(this.data instanceof Array)) {
for (var e = [], t = 0; t < this._len; t++)
e[t] = this.data[t];
this.data = e;
}
}, r.prototype.toStatic = function() {
if (this._saveData) {
this._drawPendingPt();
var e = this.data;
e instanceof Array && (e.length = this._len, Kc && this._len > 11 && (this.data = new Float32Array(e)));
}
}, r.prototype.getBoundingRect = function() {
zr[0] = zr[1] = Gr[0] = Gr[1] = Number.MAX_VALUE, Bn[0] = Bn[1] = Fr[0] = Fr[1] = -Number.MAX_VALUE;
var e = this.data, t = 0, n = 0, a = 0, i = 0, o;
for (o = 0; o < this._len; ) {
var s = e[o++], l = o === 1;
switch (l && (t = e[o], n = e[o + 1], a = t, i = n), s) {
case Nt.M:
t = a = e[o++], n = i = e[o++], Gr[0] = a, Gr[1] = i, Fr[0] = a, Fr[1] = i;
break;
case Nt.L:
j0(t, n, e[o], e[o + 1], Gr, Fr), t = e[o++], n = e[o++];
break;
case Nt.C:
Hk(t, n, e[o++], e[o++], e[o++], e[o++], e[o], e[o + 1], Gr, Fr), t = e[o++], n = e[o++];
break;
case Nt.Q:
Wk(t, n, e[o++], e[o++], e[o], e[o + 1], Gr, Fr), t = e[o++], n = e[o++];
break;
case Nt.A:
var u = e[o++], h = e[o++], f = e[o++], c = e[o++], v = e[o++], p = e[o++] + v;
o += 1;
var d = !e[o++];
l && (a = Ea(v) * f + u, i = Pa(v) * c + h), $k(u, h, f, c, v, p, d, Gr, Fr), t = Ea(p) * f + u, n = Pa(p) * c + h;
break;
case Nt.R:
a = t = e[o++], i = n = e[o++];
var g = e[o++], y = e[o++];
j0(a, i, a + g, i + y, Gr, Fr);
break;
case Nt.Z:
t = a, n = i;
break;
}
Qn(zr, zr, Gr), Jn(Bn, Bn, Fr);
}
return o === 0 && (zr[0] = zr[1] = Bn[0] = Bn[1] = 0), new ct(zr[0], zr[1], Bn[0] - zr[0], Bn[1] - zr[1]);
}, r.prototype._calculateLength = function() {
var e = this.data, t = this._len, n = this._ux, a = this._uy, i = 0, o = 0, s = 0, l = 0;
this._pathSegLen || (this._pathSegLen = []);
for (var u = this._pathSegLen, h = 0, f = 0, c = 0; c < t; ) {
var v = e[c++], p = c === 1;
p && (i = e[c], o = e[c + 1], s = i, l = o);
var d = -1;
switch (v) {
case Nt.M:
i = s = e[c++], o = l = e[c++];
break;
case Nt.L: {
var g = e[c++], y = e[c++], m = g - i, _ = y - o;
(fn(m) > n || fn(_) > a || c === t - 1) && (d = Math.sqrt(m * m + _ * _), i = g, o = y);
break;
}
case Nt.C: {
var S = e[c++], x = e[c++], g = e[c++], y = e[c++], b = e[c++], w = e[c++];
d = iP(i, o, S, x, g, y, b, w, 10), i = b, o = w;
break;
}
case Nt.Q: {
var S = e[c++], x = e[c++], g = e[c++], y = e[c++];
d = sP(i, o, S, x, g, y, 10), i = g, o = y;
break;
}
case Nt.A:
var T = e[c++], C = e[c++], D = e[c++], M = e[c++], I = e[c++], L = e[c++], E = L + I;
c += 1, p && (s = Ea(I) * D + T, l = Pa(I) * M + C), d = qc(D, M) * Xc(Zn, Math.abs(L)), i = Ea(E) * D + T, o = Pa(E) * M + C;
break;
case Nt.R: {
s = i = e[c++], l = o = e[c++];
var P = e[c++], k = e[c++];
d = P * 2 + k * 2;
break;
}
case Nt.Z: {
var m = s - i, _ = l - o;
d = Math.sqrt(m * m + _ * _), i = s, o = l;
break;
}
}
d >= 0 && (u[f++] = d, h += d);
}
return this._pathLen = h, h;
}, r.prototype.rebuildPath = function(e, t) {
var n = this.data, a = this._ux, i = this._uy, o = this._len, s, l, u, h, f, c, v = t < 1, p, d, g = 0, y = 0, m, _ = 0, S, x;
if (!(v && (this._pathSegLen || this._calculateLength(), p = this._pathSegLen, d = this._pathLen, m = t * d, !m)))
t: for (var b = 0; b < o; ) {
var w = n[b++], T = b === 1;
switch (T && (u = n[b], h = n[b + 1], s = u, l = h), w !== Nt.L && _ > 0 && (e.lineTo(S, x), _ = 0), w) {
case Nt.M:
s = u = n[b++], l = h = n[b++], e.moveTo(u, h);
break;
case Nt.L: {
f = n[b++], c = n[b++];
var C = fn(f - u), D = fn(c - h);
if (C > a || D > i) {
if (v) {
var M = p[y++];
if (g + M > m) {
var I = (m - g) / M;
e.lineTo(u * (1 - I) + f * I, h * (1 - I) + c * I);
break t;
}
g += M;
}
e.lineTo(f, c), u = f, h = c, _ = 0;
} else {
var L = C * C + D * D;
L > _ && (S = f, x = c, _ = L);
}
break;
}
case Nt.C: {
var E = n[b++], P = n[b++], k = n[b++], N = n[b++], R = n[b++], V = n[b++];
if (v) {
var M = p[y++];
if (g + M > m) {
var I = (m - g) / M;
fa(u, E, k, R, I, Ia), fa(h, P, N, V, I, La), e.bezierCurveTo(Ia[1], La[1], Ia[2], La[2], Ia[3], La[3]);
break t;
}
g += M;
}
e.bezierCurveTo(E, P, k, N, R, V), u = R, h = V;
break;
}
case Nt.Q: {
var E = n[b++], P = n[b++], k = n[b++], N = n[b++];
if (v) {
var M = p[y++];
if (g + M > m) {
var I = (m - g) / M;
sl(u, E, k, I, Ia), sl(h, P, N, I, La), e.quadraticCurveTo(Ia[1], La[1], Ia[2], La[2]);
break t;
}
g += M;
}
e.quadraticCurveTo(E, P, k, N), u = k, h = N;
break;
}
case Nt.A:
var F = n[b++], H = n[b++], $ = n[b++], j = n[b++], Q = n[b++], st = n[b++], Et = n[b++], qt = !n[b++], vt = $ > j ? $ : j, rt = fn($ - j) > 1e-3, dt = Q + st, q = !1;
if (v) {
var M = p[y++];
g + M > m && (dt = Q + st * (m - g) / M, q = !0), g += M;
}
if (rt && e.ellipse ? e.ellipse(F, H, $, j, Et, Q, dt, qt) : e.arc(F, H, vt, Q, dt, qt), q)
break t;
T && (s = Ea(Q) * $ + F, l = Pa(Q) * j + H), u = Ea(dt) * $ + F, h = Pa(dt) * j + H;
break;
case Nt.R:
s = u = n[b], l = h = n[b + 1], f = n[b++], c = n[b++];
var lt = n[b++], Vt = n[b++];
if (v) {
var M = p[y++];
if (g + M > m) {
var Lt = m - g;
e.moveTo(f, c), e.lineTo(f + Xc(Lt, lt), c), Lt -= lt, Lt > 0 && e.lineTo(f + lt, c + Xc(Lt, Vt)), Lt -= Vt, Lt > 0 && e.lineTo(f + qc(lt - Lt, 0), c + Vt), Lt -= lt, Lt > 0 && e.lineTo(f, c + qc(Vt - Lt, 0));
break t;
}
g += M;
}
e.rect(f, c, lt, Vt);
break;
case Nt.Z:
if (v) {
var M = p[y++];
if (g + M > m) {
var I = (m - g) / M;
e.lineTo(u * (1 - I) + s * I, h * (1 - I) + l * I);
break t;
}
g += M;
}
e.closePath(), u = s, h = l;
}
}
}, r.prototype.clone = function() {
var e = new r(), t = this.data;
return e.data = t.slice ? t.slice() : Array.prototype.slice.call(t), e._len = this._len, e;
}, r.CMD = Nt, r.initDefaultProps = function() {
var e = r.prototype;
e._saveData = !0, e._ux = 0, e._uy = 0, e._pendingPtDist = 0, e._version = 0;
}(), r;
}();
function qn(r, e, t, n, a, i, o) {
if (a === 0)
return !1;
var s = a, l = 0, u = r;
if (o > e + s && o > n + s || o < e - s && o < n - s || i > r + s && i > t + s || i < r - s && i < t - s)
return !1;
if (r !== t)
l = (e - n) / (r - t), u = (r * n - t * e) / (r - t);
else
return Math.abs(i - r) <= s / 2;
var h = l * i - o + u, f = h * h / (l * l + 1);
return f <= s / 2 * s / 2;
}
function Uk(r, e, t, n, a, i, o, s, l, u, h) {
if (l === 0)
return !1;
var f = l;
if (h > e + f && h > n + f && h > i + f && h > s + f || h < e - f && h < n - f && h < i - f && h < s - f || u > r + f && u > t + f && u > a + f && u > o + f || u < r - f && u < t - f && u < a - f && u < o - f)
return !1;
var c = qT(r, e, t, n, a, i, o, s, u, h, null);
return c <= f / 2;
}
function IC(r, e, t, n, a, i, o, s, l) {
if (o === 0)
return !1;
var u = o;
if (l > e + u && l > n + u && l > i + u || l < e - u && l < n - u && l < i - u || s > r + u && s > t + u && s > a + u || s < r - u && s < t - u && s < a - u)
return !1;
var h = jT(r, e, t, n, a, i, s, l, null);
return h <= u / 2;
}
var t_ = Math.PI * 2;
function Je(r) {
return r %= t_, r < 0 && (r += t_), r;
}
var ss = Math.PI * 2;
function Yk(r, e, t, n, a, i, o, s, l) {
if (o === 0)
return !1;
var u = o;
s -= r, l -= e;
var h = Math.sqrt(s * s + l * l);
if (h - u > t || h + u < t)
return !1;
if (Math.abs(n - a) % ss < 1e-4)
return !0;
if (i) {
var f = n;
n = Je(a), a = Je(f);
} else
n = Je(n), a = Je(a);
n > a && (a += ss);
var c = Math.atan2(l, s);
return c < 0 && (c += ss), c >= n && c <= a || c + ss >= n && c + ss <= a;
}
function dn(r, e, t, n, a, i) {
if (i > e && i > n || i < e && i < n || n === e)
return 0;
var o = (i - e) / (n - e), s = n < e ? 1 : -1;
(o === 1 || o === 0) && (s = n < e ? 0.5 : -0.5);
var l = o * (t - r) + r;
return l === a ? 1 / 0 : l > a ? s : 0;
}
var zn = sn.CMD, ka = Math.PI * 2, Zk = 1e-4;
function Xk(r, e) {
return Math.abs(r - e) < Zk;
}
var Ee = [-1, -1, -1], fr = [-1, -1];
function qk() {
var r = fr[0];
fr[0] = fr[1], fr[1] = r;
}
function Kk(r, e, t, n, a, i, o, s, l, u) {
if (u > e && u > n && u > i && u > s || u < e && u < n && u < i && u < s)
return 0;
var h = Eh(e, n, i, s, u, Ee);
if (h === 0)
return 0;
for (var f = 0, c = -1, v = void 0, p = void 0, d = 0; d < h; d++) {
var g = Ee[d], y = g === 0 || g === 1 ? 0.5 : 1, m = ue(r, t, a, o, g);
m < l || (c < 0 && (c = XT(e, n, i, s, fr), fr[1] < fr[0] && c > 1 && qk(), v = ue(e, n, i, s, fr[0]), c > 1 && (p = ue(e, n, i, s, fr[1]))), c === 2 ? g < fr[0] ? f += v < e ? y : -y : g < fr[1] ? f += p < v ? y : -y : f += s < p ? y : -y : g < fr[0] ? f += v < e ? y : -y : f += s < v ? y : -y);
}
return f;
}
function jk(r, e, t, n, a, i, o, s) {
if (s > e && s > n && s > i || s < e && s < n && s < i)
return 0;
var l = oP(e, n, i, s, Ee);
if (l === 0)
return 0;
var u = KT(e, n, i);
if (u >= 0 && u <= 1) {
for (var h = 0, f = de(e, n, i, u), c = 0; c < l; c++) {
var v = Ee[c] === 0 || Ee[c] === 1 ? 0.5 : 1, p = de(r, t, a, Ee[c]);
p < o || (Ee[c] < u ? h += f < e ? v : -v : h += i < f ? v : -v);
}
return h;
} else {
var v = Ee[0] === 0 || Ee[0] === 1 ? 0.5 : 1, p = de(r, t, a, Ee[0]);
return p < o ? 0 : i < e ? v : -v;
}
}
function Qk(r, e, t, n, a, i, o, s) {
if (s -= e, s > t || s < -t)
return 0;
var l = Math.sqrt(t * t - s * s);
Ee[0] = -l, Ee[1] = l;
var u = Math.abs(n - a);
if (u < 1e-4)
return 0;
if (u >= ka - 1e-4) {
n = 0, a = ka;
var h = i ? 1 : -1;
return o >= Ee[0] + r && o <= Ee[1] + r ? h : 0;
}
if (n > a) {
var f = n;
n = a, a = f;
}
n < 0 && (n += ka, a += ka);
for (var c = 0, v = 0; v < 2; v++) {
var p = Ee[v];
if (p + r > o) {
var d = Math.atan2(s, p), h = i ? 1 : -1;
d < 0 && (d = ka + d), (d >= n && d <= a || d + ka >= n && d + ka <= a) && (d > Math.PI / 2 && d < Math.PI * 1.5 && (h = -h), c += h);
}
}
return c;
}
function LC(r, e, t, n, a) {
for (var i = r.data, o = r.len(), s = 0, l = 0, u = 0, h = 0, f = 0, c, v, p = 0; p < o; ) {
var d = i[p++], g = p === 1;
switch (d === zn.M && p > 1 && (t || (s += dn(l, u, h, f, n, a))), g && (l = i[p], u = i[p + 1], h = l, f = u), d) {
case zn.M:
h = i[p++], f = i[p++], l = h, u = f;
break;
case zn.L:
if (t) {
if (qn(l, u, i[p], i[p + 1], e, n, a))
return !0;
} else
s += dn(l, u, i[p], i[p + 1], n, a) || 0;
l = i[p++], u = i[p++];
break;
case zn.C:
if (t) {
if (Uk(l, u, i[p++], i[p++], i[p++], i[p++], i[p], i[p + 1], e, n, a))
return !0;
} else
s += Kk(l, u, i[p++], i[p++], i[p++], i[p++], i[p], i[p + 1], n, a) || 0;
l = i[p++], u = i[p++];
break;
case zn.Q:
if (t) {
if (IC(l, u, i[p++], i[p++], i[p], i[p + 1], e, n, a))
return !0;
} else
s += jk(l, u, i[p++], i[p++], i[p], i[p + 1], n, a) || 0;
l = i[p++], u = i[p++];
break;
case zn.A:
var y = i[p++], m = i[p++], _ = i[p++], S = i[p++], x = i[p++], b = i[p++];
p += 1;
var w = !!(1 - i[p++]);
c = Math.cos(x) * _ + y, v = Math.sin(x) * S + m, g ? (h = c, f = v) : s += dn(l, u, c, v, n, a);
var T = (n - y) * S / _ + y;
if (t) {
if (Yk(y, m, S, x, x + b, w, e, T, a))
return !0;
} else
s += Qk(y, m, S, x, x + b, w, T, a);
l = Math.cos(x + b) * _ + y, u = Math.sin(x + b) * S + m;
break;
case zn.R:
h = l = i[p++], f = u = i[p++];
var C = i[p++], D = i[p++];
if (c = h + C, v = f + D, t) {
if (qn(h, f, c, f, e, n, a) || qn(c, f, c, v, e, n, a) || qn(c, v, h, v, e, n, a) || qn(h, v, h, f, e, n, a))
return !0;
} else
s += dn(c, f, c, v, n, a), s += dn(h, v, h, f, n, a);
break;
case zn.Z:
if (t) {
if (qn(l, u, h, f, e, n, a))
return !0;
} else
s += dn(l, u, h, f, n, a);
l = h, u = f;
break;
}
}
return !t && !Xk(u, f) && (s += dn(l, u, h, f, n, a) || 0), s !== 0;
}
function Jk(r, e, t) {
return LC(r, 0, !1, e, t);
}
function tR(r, e, t, n) {
return LC(r, e, !0, t, n);
}
var Vh = et({
fill: "#000",
stroke: null,
strokePercent: 1,
fillOpacity: 1,
strokeOpacity: 1,
lineDashOffset: 0,
lineWidth: 1,
lineCap: "butt",
miterLimit: 10,
strokeNoScale: !1,
strokeFirst: !1
}, fi), eR = {
style: et({
fill: !0,
stroke: !0,
strokePercent: !0,
fillOpacity: !0,
strokeOpacity: !0,
lineDashOffset: !0,
lineWidth: !0,
miterLimit: !0
}, Ff.style)
}, Qc = an.concat([
"invisible",
"culling",
"z",
"z2",
"zlevel",
"parent"
]), mt = function(r) {
Ht(e, r);
function e(t) {
return r.call(this, t) || this;
}
return e.prototype.update = function() {
var t = this;
r.prototype.update.call(this);
var n = this.style;
if (n.decal) {
var a = this._decalEl = this._decalEl || new e();
a.buildPath === e.prototype.buildPath && (a.buildPath = function(l) {
t.buildPath(l, t.shape);
}), a.silent = !0;
var i = a.style;
for (var o in n)
i[o] !== n[o] && (i[o] = n[o]);
i.fill = n.fill ? n.decal : null, i.decal = null, i.shadowColor = null, n.strokeFirst && (i.stroke = null);
for (var s = 0; s < Qc.length; ++s)
a[Qc[s]] = this[Qc[s]];
a.__dirty |= tn;
} else this._decalEl && (this._decalEl = null);
}, e.prototype.getDecalElement = function() {
return this._decalEl;
}, e.prototype._init = function(t) {
var n = St(t);
this.shape = this.getDefaultShape();
var a = this.getDefaultStyle();
a && this.useStyle(a);
for (var i = 0; i < n.length; i++) {
var o = n[i], s = t[o];
o === "style" ? this.style ? B(this.style, s) : this.useStyle(s) : o === "shape" ? B(this.shape, s) : r.prototype.attrKV.call(this, o, s);
}
this.style || this.useStyle({});
}, e.prototype.getDefaultStyle = function() {
return null;
}, e.prototype.getDefaultShape = function() {
return {};
}, e.prototype.canBeInsideText = function() {
return this.hasFill();
}, e.prototype.getInsideTextFill = function() {
var t = this.style.fill;
if (t !== "none") {
if (U(t)) {
var n = kh(t, 0);
return n > 0.5 ? gd : n > 0.2 ? NP : yd;
} else if (t)
return yd;
}
return gd;
}, e.prototype.getInsideTextStroke = function(t) {
var n = this.style.fill;
if (U(n)) {
var a = this.__zr, i = !!(a && a.isDarkMode()), o = kh(t, 0) < dd;
if (i === o)
return n;
}
}, e.prototype.buildPath = function(t, n, a) {
}, e.prototype.pathUpdated = function() {
this.__dirty &= -5;
}, e.prototype.getUpdatedPathProxy = function(t) {
return !this.path && this.createPathProxy(), this.path.beginPath(), this.buildPath(this.path, this.shape, t), this.path;
}, e.prototype.createPathProxy = function() {
this.path = new sn(!1);
}, e.prototype.hasStroke = function() {
var t = this.style, n = t.stroke;
return !(n == null || n === "none" || !(t.lineWidth > 0));
}, e.prototype.hasFill = function() {
var t = this.style, n = t.fill;
return n != null && n !== "none";
}, e.prototype.getBoundingRect = function() {
var t = this._rect, n = this.style, a = !t;
if (a) {
var i = !1;
this.path || (i = !0, this.createPathProxy());
var o = this.path;
(i || this.__dirty & Ls) && (o.beginPath(), this.buildPath(o, this.shape, !1), this.pathUpdated()), t = o.getBoundingRect();
}
if (this._rect = t, this.hasStroke() && this.path && this.path.len() > 0) {
var s = this._rectStroke || (this._rectStroke = t.clone());
if (this.__dirty || a) {
s.copy(t);
var l = n.strokeNoScale ? this.getLineScale() : 1, u = n.lineWidth;
if (!this.hasFill()) {
var h = this.strokeContainThreshold;
u = Math.max(u, h ?? 4);
}
l > 1e-10 && (s.width += u / l, s.height += u / l, s.x -= u / l / 2, s.y -= u / l / 2);
}
return s;
}
return t;
}, e.prototype.contain = function(t, n) {
var a = this.transformCoordToLocal(t, n), i = this.getBoundingRect(), o = this.style;
if (t = a[0], n = a[1], i.contain(t, n)) {
var s = this.path;
if (this.hasStroke()) {
var l = o.lineWidth, u = o.strokeNoScale ? this.getLineScale() : 1;
if (u > 1e-10 && (this.hasFill() || (l = Math.max(l, this.strokeContainThreshold)), tR(s, l / u, t, n)))
return !0;
}
if (this.hasFill())
return Jk(s, t, n);
}
return !1;
}, e.prototype.dirtyShape = function() {
this.__dirty |= Ls, this._rect && (this._rect = null), this._decalEl && this._decalEl.dirtyShape(), this.markRedraw();
}, e.prototype.dirty = function() {
this.dirtyStyle(), this.dirtyShape();
}, e.prototype.animateShape = function(t) {
return this.animate("shape", t);
}, e.prototype.updateDuringAnimation = function(t) {
t === "style" ? this.dirtyStyle() : t === "shape" ? this.dirtyShape() : this.markRedraw();
}, e.prototype.attrKV = function(t, n) {
t === "shape" ? this.setShape(n) : r.prototype.attrKV.call(this, t, n);
}, e.prototype.setShape = function(t, n) {
var a = this.shape;
return a || (a = this.shape = {}), typeof t == "string" ? a[t] = n : B(a, t), this.dirtyShape(), this;
}, e.prototype.shapeChanged = function() {
return !!(this.__dirty & Ls);
}, e.prototype.createStyle = function(t) {
return Pf(Vh, t);
}, e.prototype._innerSaveToNormal = function(t) {
r.prototype._innerSaveToNormal.call(this, t);
var n = this._normalState;
t.shape && !n.shape && (n.shape = B({}, this.shape));
}, e.prototype._applyStateObj = function(t, n, a, i, o, s) {
r.prototype._applyStateObj.call(this, t, n, a, i, o, s);
var l = !(n && i), u;
if (n && n.shape ? o ? i ? u = n.shape : (u = B({}, a.shape), B(u, n.shape)) : (u = B({}, i ? this.shape : a.shape), B(u, n.shape)) : l && (u = a.shape), u)
if (o) {
this.shape = B({}, this.shape);
for (var h = {}, f = St(u), c = 0; c < f.length; c++) {
var v = f[c];
typeof u[v] == "object" ? this.shape[v] = u[v] : h[v] = u[v];
}
this._transitionState(t, {
shape: h
}, s);
} else
this.shape = u, this.dirtyShape();
}, e.prototype._mergeStates = function(t) {
for (var n = r.prototype._mergeStates.call(this, t), a, i = 0; i < t.length; i++) {
var o = t[i];
o.shape && (a = a || {}, this._mergeStyle(a, o.shape));
}
return a && (n.shape = a), n;
}, e.prototype.getAnimationStyleProps = function() {
return eR;
}, e.prototype.isZeroArea = function() {
return !1;
}, e.extend = function(t) {
var n = function(i) {
Ht(o, i);
function o(s) {
var l = i.call(this, s) || this;
return t.init && t.init.call(l, s), l;
}
return o.prototype.getDefaultStyle = function() {
return nt(t.style);
}, o.prototype.getDefaultShape = function() {
return nt(t.shape);
}, o;
}(e);
for (var a in t)
typeof t[a] == "function" && (n.prototype[a] = t[a]);
return n;
}, e.initDefaultProps = function() {
var t = e.prototype;
t.type = "path", t.strokeContainThreshold = 5, t.segmentIgnoreThreshold = 0, t.subPixelOptimize = !1, t.autoBatch = !1, t.__dirty = tn | lh | Ls;
}(), e;
}(Sr), rR = et({
strokeFirst: !0,
font: ua,
x: 0,
y: 0,
textAlign: "left",
textBaseline: "top",
miterLimit: 2
}, Vh), Co = function(r) {
Ht(e, r);
function e() {
return r !== null && r.apply(this, arguments) || this;
}
return e.prototype.hasStroke = function() {
var t = this.style, n = t.stroke;
return n != null && n !== "none" && t.lineWidth > 0;
}, e.prototype.hasFill = function() {
var t = this.style, n = t.fill;
return n != null && n !== "none";
}, e.prototype.createStyle = function(t) {
return Pf(rR, t);
}, e.prototype.setBoundingRect = function(t) {
this._rect = t;
}, e.prototype.getBoundingRect = function() {
var t = this.style;
if (!this._rect) {
var n = t.text;
n != null ? n += "" : n = "";
var a = Nl(n, t.font, t.textAlign, t.textBaseline);
if (a.x += t.x || 0, a.y += t.y || 0, this.hasStroke()) {
var i = t.lineWidth;
a.x -= i / 2, a.y -= i / 2, a.width += i, a.height += i;
}
this._rect = a;
}
return this._rect;
}, e.initDefaultProps = function() {
var t = e.prototype;
t.dirtyRectTolerance = 10;
}(), e;
}(Sr);
Co.prototype.type = "tspan";
var nR = et({
x: 0,
y: 0
}, fi), aR = {
style: et({
x: !0,
y: !0,
width: !0,
height: !0,
sx: !0,
sy: !0,
sWidth: !0,
sHeight: !0
}, Ff.style)
};
function iR(r) {
return !!(r && typeof r != "string" && r.width && r.height);
}
var ge = function(r) {
Ht(e, r);
function e() {
return r !== null && r.apply(this, arguments) || this;
}
return e.prototype.createStyle = function(t) {
return Pf(nR, t);
}, e.prototype._getSize = function(t) {
var n = this.style, a = n[t];
if (a != null)
return a;
var i = iR(n.image) ? n.image : this.__image;
if (!i)
return 0;
var o = t === "width" ? "height" : "width", s = n[o];
return s == null ? i[t] : i[t] / i[o] * s;
}, e.prototype.getWidth = function() {
return this._getSize("width");
}, e.prototype.getHeight = function() {
return this._getSize("height");
}, e.prototype.getAnimationStyleProps = function() {
return aR;
}, e.prototype.getBoundingRect = function() {
var t = this.style;
return this._rect || (this._rect = new ct(t.x || 0, t.y || 0, this.getWidth(), this.getHeight())), this._rect;
}, e;
}(Sr);
ge.prototype.type = "image";
function oR(r, e) {
var t = e.x, n = e.y, a = e.width, i = e.height, o = e.r, s, l, u, h;
a < 0 && (t = t + a, a = -a), i < 0 && (n = n + i, i = -i), typeof o == "number" ? s = l = u = h = o : o instanceof Array ? o.length === 1 ? s = l = u = h = o[0] : o.length === 2 ? (s = u = o[0], l = h = o[1]) : o.length === 3 ? (s = o[0], l = h = o[1], u = o[2]) : (s = o[0], l = o[1], u = o[2], h = o[3]) : s = l = u = h = 0;
var f;
s + l > a && (f = s + l, s *= a / f, l *= a / f), u + h > a && (f = u + h, u *= a / f, h *= a / f), l + u > i && (f = l + u, l *= i / f, u *= i / f), s + h > i && (f = s + h, s *= i / f, h *= i / f), r.moveTo(t + s, n), r.lineTo(t + a - l, n), l !== 0 && r.arc(t + a - l, n + l, l, -Math.PI / 2, 0), r.lineTo(t + a, n + i - u), u !== 0 && r.arc(t + a - u, n + i - u, u, 0, Math.PI / 2), r.lineTo(t + h, n + i), h !== 0 && r.arc(t + h, n + i - h, h, Math.PI / 2, Math.PI), r.lineTo(t, n + s), s !== 0 && r.arc(t + s, n + s, s, Math.PI, Math.PI * 1.5);
}
var po = Math.round;
function EC(r, e, t) {
if (e) {
var n = e.x1, a = e.x2, i = e.y1, o = e.y2;
r.x1 = n, r.x2 = a, r.y1 = i, r.y2 = o;
var s = t && t.lineWidth;
return s && (po(n * 2) === po(a * 2) && (r.x1 = r.x2 = ri(n, s, !0)), po(i * 2) === po(o * 2) && (r.y1 = r.y2 = ri(i, s, !0))), r;
}
}
function PC(r, e, t) {
if (e) {
var n = e.x, a = e.y, i = e.width, o = e.height;
r.x = n, r.y = a, r.width = i, r.height = o;
var s = t && t.lineWidth;
return s && (r.x = ri(n, s, !0), r.y = ri(a, s, !0), r.width = Math.max(ri(n + i, s, !1) - r.x, i === 0 ? 0 : 1), r.height = Math.max(ri(a + o, s, !1) - r.y, o === 0 ? 0 : 1)), r;
}
}
function ri(r, e, t) {
if (!e)
return r;
var n = po(r * 2);
return (n + po(e)) % 2 === 0 ? n / 2 : (n + (t ? 1 : -1)) / 2;
}
var sR = /* @__PURE__ */ function() {
function r() {
this.x = 0, this.y = 0, this.width = 0, this.height = 0;
}
return r;
}(), lR = {}, xt = function(r) {
Ht(e, r);
function e(t) {
return r.call(this, t) || this;
}
return e.prototype.getDefaultShape = function() {
return new sR();
}, e.prototype.buildPath = function(t, n) {
var a, i, o, s;
if (this.subPixelOptimize) {
var l = PC(lR, n, this.style);
a = l.x, i = l.y, o = l.width, s = l.height, l.r = n.r, n = l;
} else
a = n.x, i = n.y, o = n.width, s = n.height;
n.r ? oR(t, n) : t.rect(a, i, o, s);
}, e.prototype.isZeroArea = function() {
return !this.shape.width || !this.shape.height;
}, e;
}(mt);
xt.prototype.type = "rect";
var e_ = {
fill: "#000"
}, r_ = 2, uR = {
style: et({
fill: !0,
stroke: !0,
fillOpacity: !0,
strokeOpacity: !0,
lineWidth: !0,
fontSize: !0,
lineHeight: !0,
width: !0,
height: !0,
textShadowColor: !0,
textShadowBlur: !0,
textShadowOffsetX: !0,
textShadowOffsetY: !0,
backgroundColor: !0,
padding: !0,
borderColor: !0,
borderWidth: !0,
borderRadius: !0
}, Ff.style)
}, wt = function(r) {
Ht(e, r);
function e(t) {
var n = r.call(this) || this;
return n.type = "text", n._children = [], n._defaultStyle = e_, n.attr(t), n;
}
return e.prototype.childrenRef = function() {
return this._children;
}, e.prototype.update = function() {
r.prototype.update.call(this), this.styleChanged() && this._updateSubTexts();
for (var t = 0; t < this._children.length; t++) {
var n = this._children[t];
n.zlevel = this.zlevel, n.z = this.z, n.z2 = this.z2, n.culling = this.culling, n.cursor = this.cursor, n.invisible = this.invisible;
}
}, e.prototype.updateTransform = function() {
var t = this.innerTransformable;
t ? (t.updateTransform(), t.transform && (this.transform = t.transform)) : r.prototype.updateTransform.call(this);
}, e.prototype.getLocalTransform = function(t) {
var n = this.innerTransformable;
return n ? n.getLocalTransform(t) : r.prototype.getLocalTransform.call(this, t);
}, e.prototype.getComputedTransform = function() {
return this.__hostTarget && (this.__hostTarget.getComputedTransform(), this.__hostTarget.updateInnerText(!0)), r.prototype.getComputedTransform.call(this);
}, e.prototype._updateSubTexts = function() {
this._childCursor = 0, cR(this.style), this.style.rich ? this._updateRichTexts() : this._updatePlainTexts(), this._children.length = this._childCursor, this.styleUpdated();
}, e.prototype.addSelfToZr = function(t) {
r.prototype.addSelfToZr.call(this, t);
for (var n = 0; n < this._children.length; n++)
this._children[n].__zr = t;
}, e.prototype.removeSelfFromZr = function(t) {
r.prototype.removeSelfFromZr.call(this, t);
for (var n = 0; n < this._children.length; n++)
this._children[n].__zr = null;
}, e.prototype.getBoundingRect = function() {
if (this.styleChanged() && this._updateSubTexts(), !this._rect) {
for (var t = new ct(0, 0, 0, 0), n = this._children, a = [], i = null, o = 0; o < n.length; o++) {
var s = n[o], l = s.getBoundingRect(), u = s.getLocalTransform(a);
u ? (t.copy(l), t.applyTransform(u), i = i || t.clone(), i.union(t)) : (i = i || l.clone(), i.union(l));
}
this._rect = i || t;
}
return this._rect;
}, e.prototype.setDefaultTextStyle = function(t) {
this._defaultStyle = t || e_;
}, e.prototype.setTextContent = function(t) {
if (process.env.NODE_ENV !== "production")
throw new Error("Can't attach text on another text");
}, e.prototype._mergeStyle = function(t, n) {
if (!n)
return t;
var a = n.rich, i = t.rich || a && {};
return B(t, n), a && i ? (this._mergeRich(i, a), t.rich = i) : i && (t.rich = i), t;
}, e.prototype._mergeRich = function(t, n) {
for (var a = St(n), i = 0; i < a.length; i++) {
var o = a[i];
t[o] = t[o] || {}, B(t[o], n[o]);
}
}, e.prototype.getAnimationStyleProps = function() {
return uR;
}, e.prototype._getOrCreateChild = function(t) {
var n = this._children[this._childCursor];
return (!n || !(n instanceof t)) && (n = new t()), this._children[this._childCursor++] = n, n.__zr = this.__zr, n.parent = this, n;
}, e.prototype._updatePlainTexts = function() {
var t = this.style, n = t.font || ua, a = t.padding, i = u_(t), o = kk(i, t), s = Jc(t), l = !!t.backgroundColor, u = o.outerHeight, h = o.outerWidth, f = o.contentWidth, c = o.lines, v = o.lineHeight, p = this._defaultStyle;
this.isTruncated = !!o.isTruncated;
var d = t.x || 0, g = t.y || 0, y = t.align || p.align || "left", m = t.verticalAlign || p.verticalAlign || "top", _ = d, S = uo(g, o.contentHeight, m);
if (s || a) {
var x = Ps(d, h, y), b = uo(g, u, m);
s && this._renderBackground(t, t, x, b, h, u);
}
S += v / 2, a && (_ = l_(d, y, a), m === "top" ? S += a[0] : m === "bottom" && (S -= a[2]));
for (var w = 0, T = !1, C = s_("fill" in t ? t.fill : (T = !0, p.fill)), D = o_("stroke" in t ? t.stroke : !l && (!p.autoStroke || T) ? (w = r_, p.stroke) : null), M = t.textShadowBlur > 0, I = t.width != null && (t.overflow === "truncate" || t.overflow === "break" || t.overflow === "breakAll"), L = o.calculatedLineHeight, E = 0; E < c.length; E++) {
var P = this._getOrCreateChild(Co), k = P.createStyle();
P.useStyle(k), k.text = c[E], k.x = _, k.y = S, k.textAlign = y, k.textBaseline = "middle", k.opacity = t.opacity, k.strokeFirst = !0, M && (k.shadowBlur = t.textShadowBlur || 0, k.shadowColor = t.textShadowColor || "transparent", k.shadowOffsetX = t.textShadowOffsetX || 0, k.shadowOffsetY = t.textShadowOffsetY || 0), k.stroke = D, k.fill = C, D && (k.lineWidth = t.lineWidth || w, k.lineDash = t.lineDash, k.lineDashOffset = t.lineDashOffset || 0), k.font = n, a_(k, t), S += v, I && P.setBoundingRect(new ct(Ps(k.x, f, k.textAlign), uo(k.y, L, k.textBaseline), f, L));
}
}, e.prototype._updateRichTexts = function() {
var t = this.style, n = u_(t), a = Ok(n, t), i = a.width, o = a.outerWidth, s = a.outerHeight, l = t.padding, u = t.x || 0, h = t.y || 0, f = this._defaultStyle, c = t.align || f.align, v = t.verticalAlign || f.verticalAlign;
this.isTruncated = !!a.isTruncated;
var p = Ps(u, o, c), d = uo(h, s, v), g = p, y = d;
l && (g += l[3], y += l[0]);
var m = g + i;
Jc(t) && this._renderBackground(t, t, p, d, o, s);
for (var _ = !!t.backgroundColor, S = 0; S < a.lines.length; S++) {
for (var x = a.lines[S], b = x.tokens, w = b.length, T = x.lineHeight, C = x.width, D = 0, M = g, I = m, L = w - 1, E = void 0; D < w && (E = b[D], !E.align || E.align === "left"); )
this._placeToken(E, t, T, y, M, "left", _), C -= E.width, M += E.width, D++;
for (; L >= 0 && (E = b[L], E.align === "right"); )
this._placeToken(E, t, T, y, I, "right", _), C -= E.width, I -= E.width, L--;
for (M += (i - (M - g) - (m - I) - C) / 2; D <= L; )
E = b[D], this._placeToken(E, t, T, y, M + E.width / 2, "center", _), M += E.width, D++;
y += T;
}
}, e.prototype._placeToken = function(t, n, a, i, o, s, l) {
var u = n.rich[t.styleName] || {};
u.text = t.text;
var h = t.verticalAlign, f = i + a / 2;
h === "top" ? f = i + t.height / 2 : h === "bottom" && (f = i + a - t.height / 2);
var c = !t.isLineHolder && Jc(u);
c && this._renderBackground(u, n, s === "right" ? o - t.width : s === "center" ? o - t.width / 2 : o, f - t.height / 2, t.width, t.height);
var v = !!u.backgroundColor, p = t.textPadding;
p && (o = l_(o, s, p), f -= t.height / 2 - p[0] - t.innerHeight / 2);
var d = this._getOrCreateChild(Co), g = d.createStyle();
d.useStyle(g);
var y = this._defaultStyle, m = !1, _ = 0, S = s_("fill" in u ? u.fill : "fill" in n ? n.fill : (m = !0, y.fill)), x = o_("stroke" in u ? u.stroke : "stroke" in n ? n.stroke : !v && !l && (!y.autoStroke || m) ? (_ = r_, y.stroke) : null), b = u.textShadowBlur > 0 || n.textShadowBlur > 0;
g.text = t.text, g.x = o, g.y = f, b && (g.shadowBlur = u.textShadowBlur || n.textShadowBlur || 0, g.shadowColor = u.textShadowColor || n.textShadowColor || "transparent", g.shadowOffsetX = u.textShadowOffsetX || n.textShadowOffsetX || 0, g.shadowOffsetY = u.textShadowOffsetY || n.textShadowOffsetY || 0), g.textAlign = s, g.textBaseline = "middle", g.font = t.font || ua, g.opacity = mr(u.opacity, n.opacity, 1), a_(g, u), x && (g.lineWidth = mr(u.lineWidth, n.lineWidth, _), g.lineDash = ot(u.lineDash, n.lineDash), g.lineDashOffset = n.lineDashOffset || 0, g.stroke = x), S && (g.fill = S);
var w = t.contentWidth, T = t.contentHeight;
d.setBoundingRect(new ct(Ps(g.x, w, g.textAlign), uo(g.y, T, g.textBaseline), w, T));
}, e.prototype._renderBackground = function(t, n, a, i, o, s) {
var l = t.backgroundColor, u = t.borderWidth, h = t.borderColor, f = l && l.image, c = l && !f, v = t.borderRadius, p = this, d, g;
if (c || t.lineHeight || u && h) {
d = this._getOrCreateChild(xt), d.useStyle(d.createStyle()), d.style.fill = null;
var y = d.shape;
y.x = a, y.y = i, y.width = o, y.height = s, y.r = v, d.dirtyShape();
}
if (c) {
var m = d.style;
m.fill = l || null, m.fillOpacity = ot(t.fillOpacity, 1);
} else if (f) {
g = this._getOrCreateChild(ge), g.onload = function() {
p.dirtyStyle();
};
var _ = g.style;
_.image = l.image, _.x = a, _.y = i, _.width = o, _.height = s;
}
if (u && h) {
var m = d.style;
m.lineWidth = u, m.stroke = h, m.strokeOpacity = ot(t.strokeOpacity, 1), m.lineDash = t.borderDash, m.lineDashOffset = t.borderDashOffset || 0, d.strokeContainThreshold = 0, d.hasFill() && d.hasStroke() && (m.strokeFirst = !0, m.lineWidth *= 2);
}
var S = (d || g).style;
S.shadowBlur = t.shadowBlur || 0, S.shadowColor = t.shadowColor || "transparent", S.shadowOffsetX = t.shadowOffsetX || 0, S.shadowOffsetY = t.shadowOffsetY || 0, S.opacity = mr(t.opacity, n.opacity, 1);
}, e.makeFont = function(t) {
var n = "";
return RC(t) && (n = [
t.fontStyle,
t.fontWeight,
kC(t.fontSize),
t.fontFamily || "sans-serif"
].join(" ")), n && Ir(n) || t.textFont || t.font;
}, e;
}(Sr), hR = { left: !0, right: 1, center: 1 }, fR = { top: 1, bottom: 1, middle: 1 }, n_ = ["fontStyle", "fontWeight", "fontSize", "fontFamily"];
function kC(r) {
return typeof r == "string" && (r.indexOf("px") !== -1 || r.indexOf("rem") !== -1 || r.indexOf("em") !== -1) ? r : isNaN(+r) ? qg + "px" : r + "px";
}
function a_(r, e) {
for (var t = 0; t < n_.length; t++) {
var n = n_[t], a = e[n];
a != null && (r[n] = a);
}
}
function RC(r) {
return r.fontSize != null || r.fontFamily || r.fontWeight;
}
function cR(r) {
return i_(r), A(r.rich, i_), r;
}
function i_(r) {
if (r) {
r.font = wt.makeFont(r);
var e = r.align;
e === "middle" && (e = "center"), r.align = e == null || hR[e] ? e : "left";
var t = r.verticalAlign;
t === "center" && (t = "middle"), r.verticalAlign = t == null || fR[t] ? t : "top";
var n = r.padding;
n && (r.padding = ty(r.padding));
}
}
function o_(r, e) {
return r == null || e <= 0 || r === "transparent" || r === "none" ? null : r.image || r.colorStops ? "#000" : r;
}
function s_(r) {
return r == null || r === "none" ? null : r.image || r.colorStops ? "#000" : r;
}
function l_(r, e, t) {
return e === "right" ? r - t[1] : e === "center" ? r + t[3] / 2 - t[1] / 2 : r + t[3];
}
function u_(r) {
var e = r.text;
return e != null && (e += ""), e;
}
function Jc(r) {
return !!(r.backgroundColor || r.lineHeight || r.borderWidth && r.borderColor);
}
var it = bt(), Td = function(r, e, t, n) {
if (n) {
var a = it(n);
a.dataIndex = t, a.dataType = e, a.seriesIndex = r, a.ssrType = "chart", n.type === "group" && n.traverse(function(i) {
var o = it(i);
o.seriesIndex = r, o.dataIndex = t, o.dataType = e, o.ssrType = "chart";
});
}
}, h_ = 1, f_ = {}, NC = bt(), vy = bt(), py = 0, Vl = 1, Wf = 2, ze = ["emphasis", "blur", "select"], fl = ["normal", "emphasis", "blur", "select"], zo = 10, vR = 9, ci = "highlight", ch = "downplay", Ks = "select", vh = "unselect", js = "toggleSelect";
function Hi(r) {
return r != null && r !== "none";
}
function $f(r, e, t) {
r.onHoverStateChange && (r.hoverState || 0) !== t && r.onHoverStateChange(e), r.hoverState = t;
}
function OC(r) {
$f(r, "emphasis", Wf);
}
function VC(r) {
r.hoverState === Wf && $f(r, "normal", py);
}
function dy(r) {
$f(r, "blur", Vl);
}
function BC(r) {
r.hoverState === Vl && $f(r, "normal", py);
}
function pR(r) {
r.selected = !0;
}
function dR(r) {
r.selected = !1;
}
function c_(r, e, t) {
e(r, t);
}
function Rn(r, e, t) {
c_(r, e, t), r.isGroup && r.traverse(function(n) {
c_(n, e, t);
});
}
function Bh(r, e) {
switch (e) {
case "emphasis":
r.hoverState = Wf;
break;
case "normal":
r.hoverState = py;
break;
case "blur":
r.hoverState = Vl;
break;
case "select":
r.selected = !0;
}
}
function gR(r, e, t, n) {
for (var a = r.style, i = {}, o = 0; o < e.length; o++) {
var s = e[o], l = a[s];
i[s] = l ?? (n && n[s]);
}
for (var o = 0; o < r.animators.length; o++) {
var u = r.animators[o];
u.__fromStateTransition && u.__fromStateTransition.indexOf(t) < 0 && u.targetName === "style" && u.saveTo(i, e);
}
return i;
}
function yR(r, e, t, n) {
var a = t && pt(t, "select") >= 0, i = !1;
if (r instanceof mt) {
var o = NC(r), s = a && o.selectFill || o.normalFill, l = a && o.selectStroke || o.normalStroke;
if (Hi(s) || Hi(l)) {
n = n || {};
var u = n.style || {};
u.fill === "inherit" ? (i = !0, n = B({}, n), u = B({}, u), u.fill = s) : !Hi(u.fill) && Hi(s) ? (i = !0, n = B({}, n), u = B({}, u), u.fill = ld(s)) : !Hi(u.stroke) && Hi(l) && (i || (n = B({}, n), u = B({}, u)), u.stroke = ld(l)), n.style = u;
}
}
if (n && n.z2 == null) {
i || (n = B({}, n));
var h = r.z2EmphasisLift;
n.z2 = r.z2 + (h ?? zo);
}
return n;
}
function mR(r, e, t) {
if (t && t.z2 == null) {
t = B({}, t);
var n = r.z2SelectLift;
t.z2 = r.z2 + (n ?? vR);
}
return t;
}
function _R(r, e, t) {
var n = pt(r.currentStates, e) >= 0, a = r.style.opacity, i = n ? null : gR(r, ["opacity"], e, {
opacity: 1
});
t = t || {};
var o = t.style || {};
return o.opacity == null && (t = B({}, t), o = B({
// Already being applied 'emphasis'. DON'T mul opacity multiple times.
opacity: n ? a : i.opacity * 0.1
}, o), t.style = o), t;
}
function tv(r, e) {
var t = this.states[r];
if (this.style) {
if (r === "emphasis")
return yR(this, r, e, t);
if (r === "blur")
return _R(this, r, t);
if (r === "select")
return mR(this, r, t);
}
return t;
}
function Ti(r) {
r.stateProxy = tv;
var e = r.getTextContent(), t = r.getTextGuideLine();
e && (e.stateProxy = tv), t && (t.stateProxy = tv);
}
function v_(r, e) {
!HC(r, e) && !r.__highByOuter && Rn(r, OC);
}
function p_(r, e) {
!HC(r, e) && !r.__highByOuter && Rn(r, VC);
}
function Mn(r, e) {
r.__highByOuter |= 1 << (e || 0), Rn(r, OC);
}
function In(r, e) {
!(r.__highByOuter &= ~(1 << (e || 0))) && Rn(r, VC);
}
function zC(r) {
Rn(r, dy);
}
function gy(r) {
Rn(r, BC);
}
function GC(r) {
Rn(r, pR);
}
function FC(r) {
Rn(r, dR);
}
function HC(r, e) {
return r.__highDownSilentOnTouch && e.zrByTouch;
}
function WC(r) {
var e = r.getModel(), t = [], n = [];
e.eachComponent(function(a, i) {
var o = vy(i), s = a === "series", l = s ? r.getViewOfSeriesModel(i) : r.getViewOfComponentModel(i);
!s && n.push(l), o.isBlured && (l.group.traverse(function(u) {
BC(u);
}), s && t.push(i)), o.isBlured = !1;
}), A(n, function(a) {
a && a.toggleBlurSeries && a.toggleBlurSeries(t, !1, e);
});
}
function Cd(r, e, t, n) {
var a = n.getModel();
t = t || "coordinateSystem";
function i(u, h) {
for (var f = 0; f < h.length; f++) {
var c = u.getItemGraphicEl(h[f]);
c && gy(c);
}
}
if (r != null && !(!e || e === "none")) {
var o = a.getSeriesByIndex(r), s = o.coordinateSystem;
s && s.master && (s = s.master);
var l = [];
a.eachSeries(function(u) {
var h = o === u, f = u.coordinateSystem;
f && f.master && (f = f.master);
var c = f && s ? f === s : h;
if (!// Not blur other series if blurScope series
(t === "series" && !h || t === "coordinateSystem" && !c || e === "series" && h)) {
var v = n.getViewOfSeriesModel(u);
if (v.group.traverse(function(g) {
g.__highByOuter && h && e === "self" || dy(g);
}), De(e))
i(u.getData(), e);
else if (J(e))
for (var p = St(e), d = 0; d < p.length; d++)
i(u.getData(p[d]), e[p[d]]);
l.push(u), vy(u).isBlured = !0;
}
}), a.eachComponent(function(u, h) {
if (u !== "series") {
var f = n.getViewOfComponentModel(h);
f && f.toggleBlurSeries && f.toggleBlurSeries(l, !0, a);
}
});
}
}
function Dd(r, e, t) {
if (!(r == null || e == null)) {
var n = t.getModel().getComponent(r, e);
if (n) {
vy(n).isBlured = !0;
var a = t.getViewOfComponentModel(n);
!a || !a.focusBlurEnabled || a.group.traverse(function(i) {
dy(i);
});
}
}
}
function SR(r, e, t) {
var n = r.seriesIndex, a = r.getData(e.dataType);
if (!a) {
process.env.NODE_ENV !== "production" && _e("Unknown dataType " + e.dataType);
return;
}
var i = bi(a, e);
i = (z(i) ? i[0] : i) || 0;
var o = a.getItemGraphicEl(i);
if (!o)
for (var s = a.count(), l = 0; !o && l < s; )
o = a.getItemGraphicEl(l++);
if (o) {
var u = it(o);
Cd(n, u.focus, u.blurScope, t);
} else {
var h = r.get(["emphasis", "focus"]), f = r.get(["emphasis", "blurScope"]);
h != null && Cd(n, h, f, t);
}
}
function yy(r, e, t, n) {
var a = {
focusSelf: !1,
dispatchers: null
};
if (r == null || r === "series" || e == null || t == null)
return a;
var i = n.getModel().getComponent(r, e);
if (!i)
return a;
var o = n.getViewOfComponentModel(i);
if (!o || !o.findHighDownDispatchers)
return a;
for (var s = o.findHighDownDispatchers(t), l, u = 0; u < s.length; u++)
if (process.env.NODE_ENV !== "production" && !ca(s[u]) && _e("param should be highDownDispatcher"), it(s[u]).focus === "self") {
l = !0;
break;
}
return {
focusSelf: l,
dispatchers: s
};
}
function xR(r, e, t) {
process.env.NODE_ENV !== "production" && !ca(r) && _e("param should be highDownDispatcher");
var n = it(r), a = yy(n.componentMainType, n.componentIndex, n.componentHighDownName, t), i = a.dispatchers, o = a.focusSelf;
i ? (o && Dd(n.componentMainType, n.componentIndex, t), A(i, function(s) {
return v_(s, e);
})) : (Cd(n.seriesIndex, n.focus, n.blurScope, t), n.focus === "self" && Dd(n.componentMainType, n.componentIndex, t), v_(r, e));
}
function bR(r, e, t) {
process.env.NODE_ENV !== "production" && !ca(r) && _e("param should be highDownDispatcher"), WC(t);
var n = it(r), a = yy(n.componentMainType, n.componentIndex, n.componentHighDownName, t).dispatchers;
a ? A(a, function(i) {
return p_(i, e);
}) : p_(r, e);
}
function wR(r, e, t) {
if (Md(e)) {
var n = e.dataType, a = r.getData(n), i = bi(a, e);
z(i) || (i = [i]), r[e.type === js ? "toggleSelect" : e.type === Ks ? "select" : "unselect"](i, n);
}
}
function d_(r) {
var e = r.getAllData();
A(e, function(t) {
var n = t.data, a = t.type;
n.eachItemGraphicEl(function(i, o) {
r.isSelected(o, a) ? GC(i) : FC(i);
});
});
}
function TR(r) {
var e = [];
return r.eachSeries(function(t) {
var n = t.getAllData();
A(n, function(a) {
a.data;
var i = a.type, o = t.getSelectedDataIndices();
if (o.length > 0) {
var s = {
dataIndex: o,
seriesIndex: t.seriesIndex
};
i != null && (s.dataType = i), e.push(s);
}
});
}), e;
}
function vi(r, e, t) {
ni(r, !0), Rn(r, Ti), Ad(r, e, t);
}
function CR(r) {
ni(r, !1);
}
function Xt(r, e, t, n) {
n ? CR(r) : vi(r, e, t);
}
function Ad(r, e, t) {
var n = it(r);
e != null ? (n.focus = e, n.blurScope = t) : n.focus && (n.focus = null);
}
var g_ = ["emphasis", "blur", "select"], DR = {
itemStyle: "getItemStyle",
lineStyle: "getLineStyle",
areaStyle: "getAreaStyle"
};
function Se(r, e, t, n) {
t = t || "itemStyle";
for (var a = 0; a < g_.length; a++) {
var i = g_[a], o = e.getModel([i, t]), s = r.ensureState(i);
s.style = n ? n(o) : o[DR[t]]();
}
}
function ni(r, e) {
var t = e === !1, n = r;
r.highDownSilentOnTouch && (n.__highDownSilentOnTouch = r.highDownSilentOnTouch), (!t || n.__highDownDispatcher) && (n.__highByOuter = n.__highByOuter || 0, n.__highDownDispatcher = !t);
}
function ca(r) {
return !!(r && r.__highDownDispatcher);
}
function AR(r, e, t) {
var n = it(r);
n.componentMainType = e.mainType, n.componentIndex = e.componentIndex, n.componentHighDownName = t;
}
function MR(r) {
var e = f_[r];
return e == null && h_ <= 32 && (e = f_[r] = h_++), e;
}
function Md(r) {
var e = r.type;
return e === Ks || e === vh || e === js;
}
function y_(r) {
var e = r.type;
return e === ci || e === ch;
}
function IR(r) {
var e = NC(r);
e.normalFill = r.style.fill, e.normalStroke = r.style.stroke;
var t = r.states.select || {};
e.selectFill = t.style && t.style.fill || null, e.selectStroke = t.style && t.style.stroke || null;
}
var Wi = sn.CMD, LR = [[], [], []], m_ = Math.sqrt, ER = Math.atan2;
function $C(r, e) {
if (e) {
var t = r.data, n = r.len(), a, i, o, s, l, u, h = Wi.M, f = Wi.C, c = Wi.L, v = Wi.R, p = Wi.A, d = Wi.Q;
for (o = 0, s = 0; o < n; ) {
switch (a = t[o++], s = o, i = 0, a) {
case h:
i = 1;
break;
case c:
i = 1;
break;
case f:
i = 3;
break;
case d:
i = 2;
break;
case p:
var g = e[4], y = e[5], m = m_(e[0] * e[0] + e[1] * e[1]), _ = m_(e[2] * e[2] + e[3] * e[3]), S = ER(-e[1] / _, e[0] / m);
t[o] *= m, t[o++] += g, t[o] *= _, t[o++] += y, t[o++] *= m, t[o++] *= _, t[o++] += S, t[o++] += S, o += 2, s = o;
break;
case v:
u[0] = t[o++], u[1] = t[o++], me(u, u, e), t[s++] = u[0], t[s++] = u[1], u[0] += t[o++], u[1] += t[o++], me(u, u, e), t[s++] = u[0], t[s++] = u[1];
}
for (l = 0; l < i; l++) {
var x = LR[l];
x[0] = t[o++], x[1] = t[o++], me(x, x, e), t[s++] = x[0], t[s++] = x[1];
}
}
r.increaseVersion();
}
}
var ev = Math.sqrt, du = Math.sin, gu = Math.cos, ls = Math.PI;
function __(r) {
return Math.sqrt(r[0] * r[0] + r[1] * r[1]);
}
function Id(r, e) {
return (r[0] * e[0] + r[1] * e[1]) / (__(r) * __(e));
}
function S_(r, e) {
return (r[0] * e[1] < r[1] * e[0] ? -1 : 1) * Math.acos(Id(r, e));
}
function x_(r, e, t, n, a, i, o, s, l, u, h) {
var f = l * (ls / 180), c = gu(f) * (r - t) / 2 + du(f) * (e - n) / 2, v = -1 * du(f) * (r - t) / 2 + gu(f) * (e - n) / 2, p = c * c / (o * o) + v * v / (s * s);
p > 1 && (o *= ev(p), s *= ev(p));
var d = (a === i ? -1 : 1) * ev((o * o * (s * s) - o * o * (v * v) - s * s * (c * c)) / (o * o * (v * v) + s * s * (c * c))) || 0, g = d * o * v / s, y = d * -s * c / o, m = (r + t) / 2 + gu(f) * g - du(f) * y, _ = (e + n) / 2 + du(f) * g + gu(f) * y, S = S_([1, 0], [(c - g) / o, (v - y) / s]), x = [(c - g) / o, (v - y) / s], b = [(-1 * c - g) / o, (-1 * v - y) / s], w = S_(x, b);
if (Id(x, b) <= -1 && (w = ls), Id(x, b) >= 1 && (w = 0), w < 0) {
var T = Math.round(w / ls * 1e6) / 1e6;
w = ls * 2 + T % 2 * ls;
}
h.addData(u, m, _, o, s, S, w, f, i);
}
var PR = /([mlvhzcqtsa])([^mlvhzcqtsa]*)/ig, kR = /-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;
function RR(r) {
var e = new sn();
if (!r)
return e;
var t = 0, n = 0, a = t, i = n, o, s = sn.CMD, l = r.match(PR);
if (!l)
return e;
for (var u = 0; u < l.length; u++) {
for (var h = l[u], f = h.charAt(0), c = void 0, v = h.match(kR) || [], p = v.length, d = 0; d < p; d++)
v[d] = parseFloat(v[d]);
for (var g = 0; g < p; ) {
var y = void 0, m = void 0, _ = void 0, S = void 0, x = void 0, b = void 0, w = void 0, T = t, C = n, D = void 0, M = void 0;
switch (f) {
case "l":
t += v[g++], n += v[g++], c = s.L, e.addData(c, t, n);
break;
case "L":
t = v[g++], n = v[g++], c = s.L, e.addData(c, t, n);
break;
case "m":
t += v[g++], n += v[g++], c = s.M, e.addData(c, t, n), a = t, i = n, f = "l";
break;
case "M":
t = v[g++], n = v[g++], c = s.M, e.addData(c, t, n), a = t, i = n, f = "L";
break;
case "h":
t += v[g++], c = s.L, e.addData(c, t, n);
break;
case "H":
t = v[g++], c = s.L, e.addData(c, t, n);
break;
case "v":
n += v[g++], c = s.L, e.addData(c, t, n);
break;
case "V":
n = v[g++], c = s.L, e.addData(c, t, n);
break;
case "C":
c = s.C, e.addData(c, v[g++], v[g++], v[g++], v[g++], v[g++], v[g++]), t = v[g - 2], n = v[g - 1];
break;
case "c":
c = s.C, e.addData(c, v[g++] + t, v[g++] + n, v[g++] + t, v[g++] + n, v[g++] + t, v[g++] + n), t += v[g - 2], n += v[g - 1];
break;
case "S":
y = t, m = n, D = e.len(), M = e.data, o === s.C && (y += t - M[D - 4], m += n - M[D - 3]), c = s.C, T = v[g++], C = v[g++], t = v[g++], n = v[g++], e.addData(c, y, m, T, C, t, n);
break;
case "s":
y = t, m = n, D = e.len(), M = e.data, o === s.C && (y += t - M[D - 4], m += n - M[D - 3]), c = s.C, T = t + v[g++], C = n + v[g++], t += v[g++], n += v[g++], e.addData(c, y, m, T, C, t, n);
break;
case "Q":
T = v[g++], C = v[g++], t = v[g++], n = v[g++], c = s.Q, e.addData(c, T, C, t, n);
break;
case "q":
T = v[g++] + t, C = v[g++] + n, t += v[g++], n += v[g++], c = s.Q, e.addData(c, T, C, t, n);
break;
case "T":
y = t, m = n, D = e.len(), M = e.data, o === s.Q && (y += t - M[D - 4], m += n - M[D - 3]), t = v[g++], n = v[g++], c = s.Q, e.addData(c, y, m, t, n);
break;
case "t":
y = t, m = n, D = e.len(), M = e.data, o === s.Q && (y += t - M[D - 4], m += n - M[D - 3]), t += v[g++], n += v[g++], c = s.Q, e.addData(c, y, m, t, n);
break;
case "A":
_ = v[g++], S = v[g++], x = v[g++], b = v[g++], w = v[g++], T = t, C = n, t = v[g++], n = v[g++], c = s.A, x_(T, C, t, n, b, w, _, S, x, c, e);
break;
case "a":
_ = v[g++], S = v[g++], x = v[g++], b = v[g++], w = v[g++], T = t, C = n, t += v[g++], n += v[g++], c = s.A, x_(T, C, t, n, b, w, _, S, x, c, e);
break;
}
}
(f === "z" || f === "Z") && (c = s.Z, e.addData(c), t = a, n = i), o = c;
}
return e.toStatic(), e;
}
var UC = function(r) {
Ht(e, r);
function e() {
return r !== null && r.apply(this, arguments) || this;
}
return e.prototype.applyTransform = function(t) {
}, e;
}(mt);
function YC(r) {
return r.setData != null;
}
function ZC(r, e) {
var t = RR(r), n = B({}, e);
return n.buildPath = function(a) {
if (YC(a)) {
a.setData(t.data);
var i = a.getContext();
i && a.rebuildPath(i, 1);
} else {
var i = a;
t.rebuildPath(i, 1);
}
}, n.applyTransform = function(a) {
$C(t, a), this.dirtyShape();
}, n;
}
function XC(r, e) {
return new UC(ZC(r, e));
}
function NR(r, e) {
var t = ZC(r, e), n = function(a) {
Ht(i, a);
function i(o) {
var s = a.call(this, o) || this;
return s.applyTransform = t.applyTransform, s.buildPath = t.buildPath, s;
}
return i;
}(UC);
return n;
}
function OR(r, e) {
for (var t = [], n = r.length, a = 0; a < n; a++) {
var i = r[a];
t.push(i.getUpdatedPathProxy(!0));
}
var o = new mt(e);
return o.createPathProxy(), o.buildPath = function(s) {
if (YC(s)) {
s.appendPath(t);
var l = s.getContext();
l && s.rebuildPath(l, 1);
}
}, o;
}
function my(r, e) {
e = e || {};
var t = new mt();
return r.shape && t.setShape(r.shape), t.setStyle(r.style), e.bakeTransform ? $C(t.path, r.getComputedTransform()) : e.toLocal ? t.setLocalTransform(r.getComputedTransform()) : t.copyTransform(r), t.buildPath = r.buildPath, t.applyTransform = t.applyTransform, t.z = r.z, t.z2 = r.z2, t.zlevel = r.zlevel, t;
}
var VR = /* @__PURE__ */ function() {
function r() {
this.cx = 0, this.cy = 0, this.r = 0;
}
return r;
}(), Nn = function(r) {
Ht(e, r);
function e(t) {
return r.call(this, t) || this;
}
return e.prototype.getDefaultShape = function() {
return new VR();
}, e.prototype.buildPath = function(t, n) {
t.moveTo(n.cx + n.r, n.cy), t.arc(n.cx, n.cy, n.r, 0, Math.PI * 2);
}, e;
}(mt);
Nn.prototype.type = "circle";
var BR = /* @__PURE__ */ function() {
function r() {
this.cx = 0, this.cy = 0, this.rx = 0, this.ry = 0;
}
return r;
}(), Uf = function(r) {
Ht(e, r);
function e(t) {
return r.call(this, t) || this;
}
return e.prototype.getDefaultShape = function() {
return new BR();
}, e.prototype.buildPath = function(t, n) {
var a = 0.5522848, i = n.cx, o = n.cy, s = n.rx, l = n.ry, u = s * a, h = l * a;
t.moveTo(i - s, o), t.bezierCurveTo(i - s, o - h, i - u, o - l, i, o - l), t.bezierCurveTo(i + u, o - l, i + s, o - h, i + s, o), t.bezierCurveTo(i + s, o + h, i + u, o + l, i, o + l), t.bezierCurveTo(i - u, o + l, i - s, o + h, i - s, o), t.closePath();
}, e;
}(mt);
Uf.prototype.type = "ellipse";
var qC = Math.PI, rv = qC * 2, Ra = Math.sin, $i = Math.cos, zR = Math.acos, be = Math.atan2, b_ = Math.abs, Qs = Math.sqrt, Rs = Math.max, Hr = Math.min, Cr = 1e-4;
function GR(r, e, t, n, a, i, o, s) {
var l = t - r, u = n - e, h = o - a, f = s - i, c = f * l - h * u;
if (!(c * c < Cr))
return c = (h * (e - i) - f * (r - a)) / c, [r + c * l, e + c * u];
}
function yu(r, e, t, n, a, i, o) {
var s = r - t, l = e - n, u = (o ? i : -i) / Qs(s * s + l * l), h = u * l, f = -u * s, c = r + h, v = e + f, p = t + h, d = n + f, g = (c + p) / 2, y = (v + d) / 2, m = p - c, _ = d - v, S = m * m + _ * _, x = a - i, b = c * d - p * v, w = (_ < 0 ? -1 : 1) * Qs(Rs(0, x * x * S - b * b)), T = (b * _ - m * w) / S, C = (-b * m - _ * w) / S, D = (b * _ + m * w) / S, M = (-b * m + _ * w) / S, I = T - g, L = C - y, E = D - g, P = M - y;
return I * I + L * L > E * E + P * P && (T = D, C = M), {
cx: T,
cy: C,
x0: -h,
y0: -f,
x1: T * (a / x - 1),
y1: C * (a / x - 1)
};
}
function FR(r) {
var e;
if (z(r)) {
var t = r.length;
if (!t)
return r;
t === 1 ? e = [r[0], r[0], 0, 0] : t === 2 ? e = [r[0], r[0], r[1], r[1]] : t === 3 ? e = r.concat(r[2]) : e = r;
} else
e = [r, r, r, r];
return e;
}
function HR(r, e) {
var t, n = Rs(e.r, 0), a = Rs(e.r0 || 0, 0), i = n > 0, o = a > 0;
if (!(!i && !o)) {
if (i || (n = a, a = 0), a > n) {
var s = n;
n = a, a = s;
}
var l = e.startAngle, u = e.endAngle;
if (!(isNaN(l) || isNaN(u))) {
var h = e.cx, f = e.cy, c = !!e.clockwise, v = b_(u - l), p = v > rv && v % rv;
if (p > Cr && (v = p), !(n > Cr))
r.moveTo(h, f);
else if (v > rv - Cr)
r.moveTo(h + n * $i(l), f + n * Ra(l)), r.arc(h, f, n, l, u, !c), a > Cr && (r.moveTo(h + a * $i(u), f + a * Ra(u)), r.arc(h, f, a, u, l, c));
else {
var d = void 0, g = void 0, y = void 0, m = void 0, _ = void 0, S = void 0, x = void 0, b = void 0, w = void 0, T = void 0, C = void 0, D = void 0, M = void 0, I = void 0, L = void 0, E = void 0, P = n * $i(l), k = n * Ra(l), N = a * $i(u), R = a * Ra(u), V = v > Cr;
if (V) {
var F = e.cornerRadius;
F && (t = FR(F), d = t[0], g = t[1], y = t[2], m = t[3]);
var H = b_(n - a) / 2;
if (_ = Hr(H, y), S = Hr(H, m), x = Hr(H, d), b = Hr(H, g), C = w = Rs(_, S), D = T = Rs(x, b), (w > Cr || T > Cr) && (M = n * $i(u), I = n * Ra(u), L = a * $i(l), E = a * Ra(l), v < qC)) {
var $ = GR(P, k, L, E, M, I, N, R);
if ($) {
var j = P - $[0], Q = k - $[1], st = M - $[0], Et = I - $[1], qt = 1 / Ra(zR((j * st + Q * Et) / (Qs(j * j + Q * Q) * Qs(st * st + Et * Et))) / 2), vt = Qs($[0] * $[0] + $[1] * $[1]);
C = Hr(w, (n - vt) / (qt + 1)), D = Hr(T, (a - vt) / (qt - 1));
}
}
}
if (!V)
r.moveTo(h + P, f + k);
else if (C > Cr) {
var rt = Hr(y, C), dt = Hr(m, C), q = yu(L, E, P, k, n, rt, c), lt = yu(M, I, N, R, n, dt, c);
r.moveTo(h + q.cx + q.x0, f + q.cy + q.y0), C < w && rt === dt ? r.arc(h + q.cx, f + q.cy, C, be(q.y0, q.x0), be(lt.y0, lt.x0), !c) : (rt > 0 && r.arc(h + q.cx, f + q.cy, rt, be(q.y0, q.x0), be(q.y1, q.x1), !c), r.arc(h, f, n, be(q.cy + q.y1, q.cx + q.x1), be(lt.cy + lt.y1, lt.cx + lt.x1), !c), dt > 0 && r.arc(h + lt.cx, f + lt.cy, dt, be(lt.y1, lt.x1), be(lt.y0, lt.x0), !c));
} else
r.moveTo(h + P, f + k), r.arc(h, f, n, l, u, !c);
if (!(a > Cr) || !V)
r.lineTo(h + N, f + R);
else if (D > Cr) {
var rt = Hr(d, D), dt = Hr(g, D), q = yu(N, R, M, I, a, -dt, c), lt = yu(P, k, L, E, a, -rt, c);
r.lineTo(h + q.cx + q.x0, f + q.cy + q.y0), D < T && rt === dt ? r.arc(h + q.cx, f + q.cy, D, be(q.y0, q.x0), be(lt.y0, lt.x0), !c) : (dt > 0 && r.arc(h + q.cx, f + q.cy, dt, be(q.y0, q.x0), be(q.y1, q.x1), !c), r.arc(h, f, a, be(q.cy + q.y1, q.cx + q.x1), be(lt.cy + lt.y1, lt.cx + lt.x1), c), rt > 0 && r.arc(h + lt.cx, f + lt.cy, rt, be(lt.y1, lt.x1), be(lt.y0, lt.x0), !c));
} else
r.lineTo(h + N, f + R), r.arc(h, f, a, u, l, c);
}
r.closePath();
}
}
}
var WR = /* @__PURE__ */ function() {
function r() {
this.cx = 0, this.cy = 0, this.r0 = 0, this.r = 0, this.startAngle = 0, this.endAngle = Math.PI * 2, this.clockwise = !0, this.cornerRadius = 0;
}
return r;
}(), Ge = function(r) {
Ht(e, r);
function e(t) {
return r.call(this, t) || this;
}
return e.prototype.getDefaultShape = function() {
return new WR();
}, e.prototype.buildPath = function(t, n) {
HR(t, n);
}, e.prototype.isZeroArea = function() {
return this.shape.startAngle === this.shape.endAngle || this.shape.r === this.shape.r0;
}, e;
}(mt);
Ge.prototype.type = "sector";
var $R = /* @__PURE__ */ function() {
function r() {
this.cx = 0, this.cy = 0, this.r = 0, this.r0 = 0;
}
return r;
}(), Bl = function(r) {
Ht(e, r);
function e(t) {
return r.call(this, t) || this;
}
return e.prototype.getDefaultShape = function() {
return new $R();
}, e.prototype.buildPath = function(t, n) {
var a = n.cx, i = n.cy, o = Math.PI * 2;
t.moveTo(a + n.r, i), t.arc(a, i, n.r, 0, o, !1), t.moveTo(a + n.r0, i), t.arc(a, i, n.r0, 0, o, !0);
}, e;
}(mt);
Bl.prototype.type = "ring";
function UR(r, e, t, n) {
var a = [], i = [], o = [], s = [], l, u, h, f;
if (n) {
h = [1 / 0, 1 / 0], f = [-1 / 0, -1 / 0];
for (var c = 0, v = r.length; c < v; c++)
Qn(h, h, r[c]), Jn(f, f, r[c]);
Qn(h, h, n[0]), Jn(f, f, n[1]);
}
for (var c = 0, v = r.length; c < v; c++) {
var p = r[c];
if (t)
l = r[c ? c - 1 : v - 1], u = r[(c + 1) % v];
else if (c === 0 || c === v - 1) {
a.push(Sn(r[c]));
continue;
} else
l = r[c - 1], u = r[c + 1];
ei(i, u, l), ih(i, i, e);
var d = Jp(p, l), g = Jp(p, u), y = d + g;
y !== 0 && (d /= y, g /= y), ih(o, i, -d), ih(s, i, g);
var m = d0([], p, o), _ = d0([], p, s);
n && (Jn(m, m, h), Qn(m, m, f), Jn(_, _, h), Qn(_, _, f)), a.push(m), a.push(_);
}
return t && a.push(a.shift()), a;
}
function KC(r, e, t) {
var n = e.smooth, a = e.points;
if (a && a.length >= 2) {
if (n) {
var i = UR(a, n, t, e.smoothConstraint);
r.moveTo(a[0][0], a[0][1]);
for (var o = a.length, s = 0; s < (t ? o : o - 1); s++) {
var l = i[s * 2], u = i[s * 2 + 1], h = a[(s + 1) % o];
r.bezierCurveTo(l[0], l[1], u[0], u[1], h[0], h[1]);
}
} else {
r.moveTo(a[0][0], a[0][1]);
for (var s = 1, f = a.length; s < f; s++)
r.lineTo(a[s][0], a[s][1]);
}
t && r.closePath();
}
}
var YR = /* @__PURE__ */ function() {
function r() {
this.points = null, this.smooth = 0, this.smoothConstraint = null;
}
return r;
}(), Fe = function(r) {
Ht(e, r);
function e(t) {
return r.call(this, t) || this;
}
return e.prototype.getDefaultShape = function() {
return new YR();
}, e.prototype.buildPath = function(t, n) {
KC(t, n, !0);
}, e;
}(mt);
Fe.prototype.type = "polygon";
var ZR = /* @__PURE__ */ function() {
function r() {
this.points = null, this.percent = 1, this.smooth = 0, this.smoothConstraint = null;
}
return r;
}(), He = function(r) {
Ht(e, r);
function e(t) {
return r.call(this, t) || this;
}
return e.prototype.getDefaultStyle = function() {
return {
stroke: "#000",
fill: null
};
}, e.prototype.getDefaultShape = function() {
return new ZR();
}, e.prototype.buildPath = function(t, n) {
KC(t, n, !1);
}, e;
}(mt);
He.prototype.type = "polyline";
var XR = {}, qR = /* @__PURE__ */ function() {
function r() {
this.x1 = 0, this.y1 = 0, this.x2 = 0, this.y2 = 0, this.percent = 1;
}
return r;
}(), he = function(r) {
Ht(e, r);
function e(t) {
return r.call(this, t) || this;
}
return e.prototype.getDefaultStyle = function() {
return {
stroke: "#000",
fill: null
};
}, e.prototype.getDefaultShape = function() {
return new qR();
}, e.prototype.buildPath = function(t, n) {
var a, i, o, s;
if (this.subPixelOptimize) {
var l = EC(XR, n, this.style);
a = l.x1, i = l.y1, o = l.x2, s = l.y2;
} else
a = n.x1, i = n.y1, o = n.x2, s = n.y2;
var u = n.percent;
u !== 0 && (t.moveTo(a, i), u < 1 && (o = a * (1 - u) + o * u, s = i * (1 - u) + s * u), t.lineTo(o, s));
}, e.prototype.pointAt = function(t) {
var n = this.shape;
return [
n.x1 * (1 - t) + n.x2 * t,
n.y1 * (1 - t) + n.y2 * t
];
}, e;
}(mt);
he.prototype.type = "line";
var $e = [], KR = /* @__PURE__ */ function() {
function r() {
this.x1 = 0, this.y1 = 0, this.x2 = 0, this.y2 = 0, this.cpx1 = 0, this.cpy1 = 0, this.percent = 1;
}
return r;
}();
function w_(r, e, t) {
var n = r.cpx2, a = r.cpy2;
return n != null || a != null ? [
(t ? A0 : ue)(r.x1, r.cpx1, r.cpx2, r.x2, e),
(t ? A0 : ue)(r.y1, r.cpy1, r.cpy2, r.y2, e)
] : [
(t ? ad : de)(r.x1, r.cpx1, r.x2, e),
(t ? ad : de)(r.y1, r.cpy1, r.y2, e)
];
}
var zl = function(r) {
Ht(e, r);
function e(t) {
return r.call(this, t) || this;
}
return e.prototype.getDefaultStyle = function() {
return {
stroke: "#000",
fill: null
};
}, e.prototype.getDefaultShape = function() {
return new KR();
}, e.prototype.buildPath = function(t, n) {
var a = n.x1, i = n.y1, o = n.x2, s = n.y2, l = n.cpx1, u = n.cpy1, h = n.cpx2, f = n.cpy2, c = n.percent;
c !== 0 && (t.moveTo(a, i), h == null || f == null ? (c < 1 && (sl(a, l, o, c, $e), l = $e[1], o = $e[2], sl(i, u, s, c, $e), u = $e[1], s = $e[2]), t.quadraticCurveTo(l, u, o, s)) : (c < 1 && (fa(a, l, h, o, c, $e), l = $e[1], h = $e[2], o = $e[3], fa(i, u, f, s, c, $e), u = $e[1], f = $e[2], s = $e[3]), t.bezierCurveTo(l, u, h, f, o, s)));
}, e.prototype.pointAt = function(t) {
return w_(this.shape, t, !1);
}, e.prototype.tangentAt = function(t) {
var n = w_(this.shape, t, !0);
return Oo(n, n);
}, e;
}(mt);
zl.prototype.type = "bezier-curve";
var jR = /* @__PURE__ */ function() {
function r() {
this.cx = 0, this.cy = 0, this.r = 0, this.startAngle = 0, this.endAngle = Math.PI * 2, this.clockwise = !0;
}
return r;
}(), Yf = function(r) {
Ht(e, r);
function e(t) {
return r.call(this, t) || this;
}
return e.prototype.getDefaultStyle = function() {
return {
stroke: "#000",
fill: null
};
}, e.prototype.getDefaultShape = function() {
return new jR();
}, e.prototype.buildPath = function(t, n) {
var a = n.cx, i = n.cy, o = Math.max(n.r, 0), s = n.startAngle, l = n.endAngle, u = n.clockwise, h = Math.cos(s), f = Math.sin(s);
t.moveTo(h * o + a, f * o + i), t.arc(a, i, o, s, l, !u);
}, e;
}(mt);
Yf.prototype.type = "arc";
var _y = function(r) {
Ht(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t.type = "compound", t;
}
return e.prototype._updatePathDirty = function() {
for (var t = this.shape.paths, n = this.shapeChanged(), a = 0; a < t.length; a++)
n = n || t[a].shapeChanged();
n && this.dirtyShape();
}, e.prototype.beforeBrush = function() {
this._updatePathDirty();
for (var t = this.shape.paths || [], n = this.getGlobalScale(), a = 0; a < t.length; a++)
t[a].path || t[a].createPathProxy(), t[a].path.setScale(n[0], n[1], t[a].segmentIgnoreThreshold);
}, e.prototype.buildPath = function(t, n) {
for (var a = n.paths || [], i = 0; i < a.length; i++)
a[i].buildPath(t, a[i].shape, !0);
}, e.prototype.afterBrush = function() {
for (var t = this.shape.paths || [], n = 0; n < t.length; n++)
t[n].pathUpdated();
}, e.prototype.getBoundingRect = function() {
return this._updatePathDirty.call(this), mt.prototype.getBoundingRect.call(this);
}, e;
}(mt), jC = function() {
function r(e) {
this.colorStops = e || [];
}
return r.prototype.addColorStop = function(e, t) {
this.colorStops.push({
offset: e,
color: t
});
}, r;
}(), Gl = function(r) {
Ht(e, r);
function e(t, n, a, i, o, s) {
var l = r.call(this, o) || this;
return l.x = t ?? 0, l.y = n ?? 0, l.x2 = a ?? 1, l.y2 = i ?? 0, l.type = "linear", l.global = s || !1, l;
}
return e;
}(jC), QC = function(r) {
Ht(e, r);
function e(t, n, a, i, o) {
var s = r.call(this, i) || this;
return s.x = t ?? 0.5, s.y = n ?? 0.5, s.r = a ?? 0.5, s.type = "radial", s.global = o || !1, s;
}
return e;
}(jC), Na = [0, 0], Oa = [0, 0], mu = new ft(), _u = new ft(), zh = function() {
function r(e, t) {
this._corners = [], this._axes = [], this._origin = [0, 0];
for (var n = 0; n < 4; n++)
this._corners[n] = new ft();
for (var n = 0; n < 2; n++)
this._axes[n] = new ft();
e && this.fromBoundingRect(e, t);
}
return r.prototype.fromBoundingRect = function(e, t) {
var n = this._corners, a = this._axes, i = e.x, o = e.y, s = i + e.width, l = o + e.height;
if (n[0].set(i, o), n[1].set(s, o), n[2].set(s, l), n[3].set(i, l), t)
for (var u = 0; u < 4; u++)
n[u].transform(t);
ft.sub(a[0], n[1], n[0]), ft.sub(a[1], n[3], n[0]), a[0].normalize(), a[1].normalize();
for (var u = 0; u < 2; u++)
this._origin[u] = a[u].dot(n[0]);
}, r.prototype.intersect = function(e, t) {
var n = !0, a = !t;
return mu.set(1 / 0, 1 / 0), _u.set(0, 0), !this._intersectCheckOneSide(this, e, mu, _u, a, 1) && (n = !1, a) || !this._intersectCheckOneSide(e, this, mu, _u, a, -1) && (n = !1, a) || a || ft.copy(t, n ? mu : _u), n;
}, r.prototype._intersectCheckOneSide = function(e, t, n, a, i, o) {
for (var s = !0, l = 0; l < 2; l++) {
var u = this._axes[l];
if (this._getProjMinMaxOnAxis(l, e._corners, Na), this._getProjMinMaxOnAxis(l, t._corners, Oa), Na[1] < Oa[0] || Na[0] > Oa[1]) {
if (s = !1, i)
return s;
var h = Math.abs(Oa[0] - Na[1]), f = Math.abs(Na[0] - Oa[1]);
Math.min(h, f) > a.len() && (h < f ? ft.scale(a, u, -h * o) : ft.scale(a, u, f * o));
} else if (n) {
var h = Math.abs(Oa[0] - Na[1]), f = Math.abs(Na[0] - Oa[1]);
Math.min(h, f) < n.len() && (h < f ? ft.scale(n, u, h * o) : ft.scale(n, u, -f * o));
}
}
return s;
}, r.prototype._getProjMinMaxOnAxis = function(e, t, n) {
for (var a = this._axes[e], i = this._origin, o = t[0].dot(a) + i[e], s = o, l = o, u = 1; u < t.length; u++) {
var h = t[u].dot(a) + i[e];
s = Math.min(h, s), l = Math.max(h, l);
}
n[0] = s, n[1] = l;
}, r;
}(), QR = [], JR = function(r) {
Ht(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t.notClear = !0, t.incremental = !0, t._displayables = [], t._temporaryDisplayables = [], t._cursor = 0, t;
}
return e.prototype.traverse = function(t, n) {
t.call(n, this);
}, e.prototype.useStyle = function() {
this.style = {};
}, e.prototype.getCursor = function() {
return this._cursor;
}, e.prototype.innerAfterBrush = function() {
this._cursor = this._displayables.length;
}, e.prototype.clearDisplaybles = function() {
this._displayables = [], this._temporaryDisplayables = [], this._cursor = 0, this.markRedraw(), this.notClear = !1;
}, e.prototype.clearTemporalDisplayables = function() {
this._temporaryDisplayables = [];
}, e.prototype.addDisplayable = function(t, n) {
n ? this._temporaryDisplayables.push(t) : this._displayables.push(t), this.markRedraw();
}, e.prototype.addDisplayables = function(t, n) {
n = n || !1;
for (var a = 0; a < t.length; a++)
this.addDisplayable(t[a], n);
}, e.prototype.getDisplayables = function() {
return this._displayables;
}, e.prototype.getTemporalDisplayables = function() {
return this._temporaryDisplayables;
}, e.prototype.eachPendingDisplayable = function(t) {
for (var n = this._cursor; n < this._displayables.length; n++)
t && t(this._displayables[n]);
for (var n = 0; n < this._temporaryDisplayables.length; n++)
t && t(this._temporaryDisplayables[n]);
}, e.prototype.update = function() {
this.updateTransform();
for (var t = this._cursor; t < this._displayables.length; t++) {
var n = this._displayables[t];
n.parent = this, n.update(), n.parent = null;
}
for (var t = 0; t < this._temporaryDisplayables.length; t++) {
var n = this._temporaryDisplayables[t];
n.parent = this, n.update(), n.parent = null;
}
}, e.prototype.getBoundingRect = function() {
if (!this._rect) {
for (var t = new ct(1 / 0, 1 / 0, -1 / 0, -1 / 0), n = 0; n < this._displayables.length; n++) {
var a = this._displayables[n], i = a.getBoundingRect().clone();
a.needLocalTransform() && i.applyTransform(a.getLocalTransform(QR)), t.union(i);
}
this._rect = t;
}
return this._rect;
}, e.prototype.contain = function(t, n) {
var a = this.transformCoordToLocal(t, n), i = this.getBoundingRect();
if (i.contain(a[0], a[1]))
for (var o = 0; o < this._displayables.length; o++) {
var s = this._displayables[o];
if (s.contain(t, n))
return !0;
}
return !1;
}, e;
}(Sr), JC = bt();
function Go(r, e, t, n, a) {
var i;
if (e && e.ecModel) {
var o = e.ecModel.getUpdatePayload();
i = o && o.animation;
}
var s = e && e.isAnimationEnabled(), l = r === "update";
if (s) {
var u = void 0, h = void 0, f = void 0;
n ? (u = ot(n.duration, 200), h = ot(n.easing, "cubicOut"), f = 0) : (u = e.getShallow(l ? "animationDurationUpdate" : "animationDuration"), h = e.getShallow(l ? "animationEasingUpdate" : "animationEasing"), f = e.getShallow(l ? "animationDelayUpdate" : "animationDelay")), i && (i.duration != null && (u = i.duration), i.easing != null && (h = i.easing), i.delay != null && (f = i.delay)), K(f) && (f = f(t, a)), K(u) && (u = u(t));
var c = {
duration: u || 0,
delay: f,
easing: h
};
return c;
} else
return null;
}
function Sy(r, e, t, n, a, i, o) {
var s = !1, l;
K(a) ? (o = i, i = a, a = null) : J(a) && (i = a.cb, o = a.during, s = a.isFrom, l = a.removeOpt, a = a.dataIndex);
var u = r === "leave";
u || e.stopAnimation("leave");
var h = Go(r, n, a, u ? l || {} : null, n && n.getAnimationDelayParams ? n.getAnimationDelayParams(e, a) : null);
if (h && h.duration > 0) {
var f = h.duration, c = h.delay, v = h.easing, p = {
duration: f,
delay: c || 0,
easing: v,
done: i,
force: !!i || !!o,
// Set to final state in update/init animation.
// So the post processing based on the path shape can be done correctly.
setToFinal: !u,
scope: r,
during: o
};
s ? e.animateFrom(t, p) : e.animateTo(t, p);
} else
e.stopAnimation(), !s && e.attr(t), o && o(1), i && i();
}
function Ct(r, e, t, n, a, i) {
Sy("update", r, e, t, n, a, i);
}
function $t(r, e, t, n, a, i) {
Sy("enter", r, e, t, n, a, i);
}
function _o(r) {
if (!r.__zr)
return !0;
for (var e = 0; e < r.animators.length; e++) {
var t = r.animators[e];
if (t.scope === "leave")
return !0;
}
return !1;
}
function va(r, e, t, n, a, i) {
_o(r) || Sy("leave", r, e, t, n, a, i);
}
function T_(r, e, t, n) {
r.removeTextContent(), r.removeTextGuideLine(), va(r, {
style: {
opacity: 0
}
}, e, t, n);
}
function cl(r, e, t) {
function n() {
r.parent && r.parent.remove(r);
}
r.isGroup ? r.traverse(function(a) {
a.isGroup || T_(a, e, t, n);
}) : T_(r, e, t, n);
}
function Or(r) {
JC(r).oldStyle = r.style;
}
function tN(r) {
return JC(r).oldStyle;
}
var Gh = Math.max, Fh = Math.min, Ld = {};
function eN(r) {
return mt.extend(r);
}
var rN = NR;
function nN(r, e) {
return rN(r, e);
}
function Vr(r, e) {
Ld[r] = e;
}
function xy(r) {
if (Ld.hasOwnProperty(r))
return Ld[r];
}
function Zf(r, e, t, n) {
var a = XC(r, e);
return t && (n === "center" && (t = eD(t, a.getBoundingRect())), rD(a, t)), a;
}
function tD(r, e, t) {
var n = new ge({
style: {
image: r,
x: e.x,
y: e.y,
width: e.width,
height: e.height
},
onload: function(a) {
if (t === "center") {
var i = {
width: a.width,
height: a.height
};
n.setStyle(eD(e, i));
}
}
});
return n;
}
function eD(r, e) {
var t = e.width / e.height, n = r.height * t, a;
n <= r.width ? a = r.height : (n = r.width, a = n / t);
var i = r.x + r.width / 2, o = r.y + r.height / 2;
return {
x: i - n / 2,
y: o - a / 2,
width: n,
height: a
};
}
var dr = OR;
function rD(r, e) {
if (r.applyTransform) {
var t = r.getBoundingRect(), n = t.calculateTransform(e);
r.applyTransform(n);
}
}
function Do(r, e) {
return EC(r, r, {
lineWidth: e
}), r;
}
function aN(r) {
return PC(r.shape, r.shape, r.style), r;
}
var ph = ri;
function pi(r, e) {
for (var t = kf([]); r && r !== e; )
xn(t, r.getLocalTransform(), t), r = r.parent;
return t;
}
function kr(r, e, t) {
return e && !De(e) && (e = mn.getLocalTransform(e)), t && (e = Vo([], e)), me([], r, e);
}
function Xf(r, e, t) {
var n = e[4] === 0 || e[5] === 0 || e[0] === 0 ? 1 : Math.abs(2 * e[4] / e[0]), a = e[4] === 0 || e[5] === 0 || e[2] === 0 ? 1 : Math.abs(2 * e[4] / e[2]), i = [r === "left" ? -n : r === "right" ? n : 0, r === "top" ? -a : r === "bottom" ? a : 0];
return i = kr(i, e, t), Math.abs(i[0]) > Math.abs(i[1]) ? i[0] > 0 ? "right" : "left" : i[1] > 0 ? "bottom" : "top";
}
function C_(r) {
return !r.isGroup;
}
function iN(r) {
return r.shape != null;
}
function Fl(r, e, t) {
if (!r || !e)
return;
function n(o) {
var s = {};
return o.traverse(function(l) {
C_(l) && l.anid && (s[l.anid] = l);
}), s;
}
function a(o) {
var s = {
x: o.x,
y: o.y,
rotation: o.rotation
};
return iN(o) && (s.shape = B({}, o.shape)), s;
}
var i = n(r);
e.traverse(function(o) {
if (C_(o) && o.anid) {
var s = i[o.anid];
if (s) {
var l = a(o);
o.attr(a(s)), Ct(o, l, t, it(o).dataIndex);
}
}
});
}
function nD(r, e) {
return G(r, function(t) {
var n = t[0];
n = Gh(n, e.x), n = Fh(n, e.x + e.width);
var a = t[1];
return a = Gh(a, e.y), a = Fh(a, e.y + e.height), [n, a];
});
}
function oN(r, e) {
var t = Gh(r.x, e.x), n = Fh(r.x + r.width, e.x + e.width), a = Gh(r.y, e.y), i = Fh(r.y + r.height, e.y + e.height);
if (n >= t && i >= a)
return {
x: t,
y: a,
width: n - t,
height: i - a
};
}
function Hl(r, e, t) {
var n = B({
rectHover: !0
}, e), a = n.style = {
strokeNoScale: !0
};
if (t = t || {
x: -1,
y: -1,
width: 2,
height: 2
}, r)
return r.indexOf("image://") === 0 ? (a.image = r.slice(8), et(a, t), new ge(n)) : Zf(r.replace("path://", ""), n, t, "center");
}
function Ns(r, e, t, n, a) {
for (var i = 0, o = a[a.length - 1]; i < a.length; i++) {
var s = a[i];
if (aD(r, e, t, n, s[0], s[1], o[0], o[1]))
return !0;
o = s;
}
}
function aD(r, e, t, n, a, i, o, s) {
var l = t - r, u = n - e, h = o - a, f = s - i, c = nv(h, f, l, u);
if (sN(c))
return !1;
var v = r - a, p = e - i, d = nv(v, p, l, u) / c;
if (d < 0 || d > 1)
return !1;
var g = nv(v, p, h, f) / c;
return !(g < 0 || g > 1);
}
function nv(r, e, t, n) {
return r * n - t * e;
}
function sN(r) {
return r <= 1e-6 && r >= -1e-6;
}
function Ei(r) {
var e = r.itemTooltipOption, t = r.componentModel, n = r.itemName, a = U(e) ? {
formatter: e
} : e, i = t.mainType, o = t.componentIndex, s = {
componentType: i,
name: n,
$vars: ["name"]
};
s[i + "Index"] = o;
var l = r.formatterParamsExtra;
l && A(St(l), function(h) {
Z(s, h) || (s[h] = l[h], s.$vars.push(h));
});
var u = it(r.el);
u.componentMainType = i, u.componentIndex = o, u.tooltipConfig = {
name: n,
option: et({
content: n,
encodeHTMLContent: !0,
formatterParams: s
}, a)
};
}
function D_(r, e) {
var t;
r.isGroup && (t = e(r)), t || r.traverse(e);
}
function ma(r, e) {
if (r)
if (z(r))
for (var t = 0; t < r.length; t++)
D_(r[t], e);
else
D_(r, e);
}
Vr("circle", Nn);
Vr("ellipse", Uf);
Vr("sector", Ge);
Vr("ring", Bl);
Vr("polygon", Fe);
Vr("polyline", He);
Vr("rect", xt);
Vr("line", he);
Vr("bezierCurve", zl);
Vr("arc", Yf);
const Pi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
Arc: Yf,
BezierCurve: zl,
BoundingRect: ct,
Circle: Nn,
CompoundPath: _y,
Ellipse: Uf,
Group: at,
Image: ge,
IncrementalDisplayable: JR,
Line: he,
LinearGradient: Gl,
OrientedBoundingRect: zh,
Path: mt,
Point: ft,
Polygon: Fe,
Polyline: He,
RadialGradient: QC,
Rect: xt,
Ring: Bl,
Sector: Ge,
Text: wt,
applyTransform: kr,
clipPointsByRect: nD,
clipRectByRect: oN,
createIcon: Hl,
extendPath: nN,
extendShape: eN,
getShapeClass: xy,
getTransform: pi,
groupTransition: Fl,
initProps: $t,
isElementRemoved: _o,
lineLineIntersect: aD,
linePolygonIntersect: Ns,
makeImage: tD,
makePath: Zf,
mergePath: dr,
registerShape: Vr,
removeElement: va,
removeElementWithFadeOut: cl,
resizePath: rD,
setTooltipConfig: Ei,
subPixelOptimize: ph,
subPixelOptimizeLine: Do,
subPixelOptimizeRect: aN,
transformDirection: Xf,
traverseElements: ma,
updateProps: Ct
}, Symbol.toStringTag, { value: "Module" }));
var qf = {};
function iD(r, e) {
for (var t = 0; t < ze.length; t++) {
var n = ze[t], a = e[n], i = r.ensureState(n);
i.style = i.style || {}, i.style.text = a;
}
var o = r.currentStates.slice();
r.clearStates(!0), r.setStyle({
text: e.normal
}), r.useStates(o, !0);
}
function Ed(r, e, t) {
var n = r.labelFetcher, a = r.labelDataIndex, i = r.labelDimIndex, o = e.normal, s;
n && (s = n.getFormattedLabel(a, "normal", null, i, o && o.get("formatter"), t != null ? {
interpolatedValue: t
} : null)), s == null && (s = K(r.defaultText) ? r.defaultText(a, r, t) : r.defaultText);
for (var l = {
normal: s
}, u = 0; u < ze.length; u++) {
var h = ze[u], f = e[h];
l[h] = ot(n ? n.getFormattedLabel(a, h, null, i, f && f.get("formatter")) : null, s);
}
return l;
}
function xe(r, e, t, n) {
t = t || qf;
for (var a = r instanceof wt, i = !1, o = 0; o < fl.length; o++) {
var s = e[fl[o]];
if (s && s.getShallow("show")) {
i = !0;
break;
}
}
var l = a ? r : r.getTextContent();
if (i) {
a || (l || (l = new wt(), r.setTextContent(l)), r.stateProxy && (l.stateProxy = r.stateProxy));
var u = Ed(t, e), h = e.normal, f = !!h.getShallow("show"), c = Gt(h, n && n.normal, t, !1, !a);
c.text = u.normal, a || r.setTextConfig(Hh(h, t, !1));
for (var o = 0; o < ze.length; o++) {
var v = ze[o], s = e[v];
if (s) {
var p = l.ensureState(v), d = !!ot(s.getShallow("show"), f);
if (d !== f && (p.ignore = !d), p.style = Gt(s, n && n[v], t, !0, !a), p.style.text = u[v], !a) {
var g = r.ensureState(v);
g.textConfig = Hh(s, t, !0);
}
}
}
l.silent = !!h.getShallow("silent"), l.style.x != null && (c.x = l.style.x), l.style.y != null && (c.y = l.style.y), l.ignore = !f, l.useStyle(c), l.dirty(), t.enableTextSetter && (Fo(l).setLabelText = function(y) {
var m = Ed(t, e, y);
iD(l, m);
});
} else l && (l.ignore = !0);
r.dirty();
}
function ve(r, e) {
e = e || "label";
for (var t = {
normal: r.getModel(e)
}, n = 0; n < ze.length; n++) {
var a = ze[n];
t[a] = r.getModel([a, e]);
}
return t;
}
function Gt(r, e, t, n, a) {
var i = {};
return lN(i, r, t, n, a), e && B(i, e), i;
}
function Hh(r, e, t) {
e = e || {};
var n = {}, a, i = r.getShallow("rotate"), o = ot(r.getShallow("distance"), t ? null : 5), s = r.getShallow("offset");
return a = r.getShallow("position") || (t ? null : "inside"), a === "outside" && (a = e.defaultOutsidePosition || "top"), a != null && (n.position = a), s != null && (n.offset = s), i != null && (i *= Math.PI / 180, n.rotation = i), o != null && (n.distance = o), n.outsideFill = r.get("color") === "inherit" ? e.inheritColor || null : "auto", n;
}
function lN(r, e, t, n, a) {
t = t || qf;
var i = e.ecModel, o = i && i.option.textStyle, s = uN(e), l;
if (s) {
l = {};
for (var u in s)
if (s.hasOwnProperty(u)) {
var h = e.getModel(["rich", u]);
L_(l[u] = {}, h, o, t, n, a, !1, !0);
}
}
l && (r.rich = l);
var f = e.get("overflow");
f && (r.overflow = f);
var c = e.get("minMargin");
c != null && (r.margin = c), L_(r, e, o, t, n, a, !0, !1);
}
function uN(r) {
for (var e; r && r !== r.ecModel; ) {
var t = (r.option || qf).rich;
if (t) {
e = e || {};
for (var n = St(t), a = 0; a < n.length; a++) {
var i = n[a];
e[i] = 1;
}
}
r = r.parentModel;
}
return e;
}
var A_ = ["fontStyle", "fontWeight", "fontSize", "fontFamily", "textShadowColor", "textShadowBlur", "textShadowOffsetX", "textShadowOffsetY"], M_ = ["align", "lineHeight", "width", "height", "tag", "verticalAlign", "ellipsis"], I_ = ["padding", "borderWidth", "borderRadius", "borderDashOffset", "backgroundColor", "borderColor", "shadowColor", "shadowBlur", "shadowOffsetX", "shadowOffsetY"];
function L_(r, e, t, n, a, i, o, s) {
t = !a && t || qf;
var l = n && n.inheritColor, u = e.getShallow("color"), h = e.getShallow("textBorderColor"), f = ot(e.getShallow("opacity"), t.opacity);
(u === "inherit" || u === "auto") && (process.env.NODE_ENV !== "production" && u === "auto" && ee("color: 'auto'", "color: 'inherit'"), l ? u = l : u = null), (h === "inherit" || h === "auto") && (process.env.NODE_ENV !== "production" && h === "auto" && ee("color: 'auto'", "color: 'inherit'"), l ? h = l : h = null), i || (u = u || t.color, h = h || t.textBorderColor), u != null && (r.fill = u), h != null && (r.stroke = h);
var c = ot(e.getShallow("textBorderWidth"), t.textBorderWidth);
c != null && (r.lineWidth = c);
var v = ot(e.getShallow("textBorderType"), t.textBorderType);
v != null && (r.lineDash = v);
var p = ot(e.getShallow("textBorderDashOffset"), t.textBorderDashOffset);
p != null && (r.lineDashOffset = p), !a && f == null && !s && (f = n && n.defaultOpacity), f != null && (r.opacity = f), !a && !i && r.fill == null && n.inheritColor && (r.fill = n.inheritColor);
for (var d = 0; d < A_.length; d++) {
var g = A_[d], y = ot(e.getShallow(g), t[g]);
y != null && (r[g] = y);
}
for (var d = 0; d < M_.length; d++) {
var g = M_[d], y = e.getShallow(g);
y != null && (r[g] = y);
}
if (r.verticalAlign == null) {
var m = e.getShallow("baseline");
m != null && (r.verticalAlign = m);
}
if (!o || !n.disableBox) {
for (var d = 0; d < I_.length; d++) {
var g = I_[d], y = e.getShallow(g);
y != null && (r[g] = y);
}
var _ = e.getShallow("borderType");
_ != null && (r.borderDash = _), (r.backgroundColor === "auto" || r.backgroundColor === "inherit") && l && (process.env.NODE_ENV !== "production" && r.backgroundColor === "auto" && ee("backgroundColor: 'auto'", "backgroundColor: 'inherit'"), r.backgroundColor = l), (r.borderColor === "auto" || r.borderColor === "inherit") && l && (process.env.NODE_ENV !== "production" && r.borderColor === "auto" && ee("borderColor: 'auto'", "borderColor: 'inherit'"), r.borderColor = l);
}
}
function by(r, e) {
var t = e && e.getModel("textStyle");
return Ir([
// FIXME in node-canvas fontWeight is before fontStyle
r.fontStyle || t && t.getShallow("fontStyle") || "",
r.fontWeight || t && t.getShallow("fontWeight") || "",
(r.fontSize || t && t.getShallow("fontSize") || 12) + "px",
r.fontFamily || t && t.getShallow("fontFamily") || "sans-serif"
].join(" "));
}
var Fo = bt();
function oD(r, e, t, n) {
if (r) {
var a = Fo(r);
a.prevValue = a.value, a.value = t;
var i = e.normal;
a.valueAnimation = i.get("valueAnimation"), a.valueAnimation && (a.precision = i.get("precision"), a.defaultInterpolatedText = n, a.statesModels = e);
}
}
function sD(r, e, t, n, a) {
var i = Fo(r);
if (!i.valueAnimation || i.prevValue === i.value)
return;
var o = i.defaultInterpolatedText, s = ot(i.interpolatedValue, i.prevValue), l = i.value;
function u(h) {
var f = wC(t, i.precision, s, l, h);
i.interpolatedValue = h === 1 ? null : f;
var c = Ed({
labelDataIndex: e,
labelFetcher: a,
defaultText: o ? o(f) : f + ""
}, i.statesModels, f);
iD(r, c);
}
r.percent = 0, (i.prevValue == null ? $t : Ct)(r, {
// percent is used to prevent animation from being aborted #15916
percent: 1
}, n, e, null, u);
}
var hN = ["textStyle", "color"], av = ["fontStyle", "fontWeight", "fontSize", "fontFamily", "padding", "lineHeight", "rich", "width", "height", "overflow"], iv = new wt(), fN = (
/** @class */
function() {
function r() {
}
return r.prototype.getTextColor = function(e) {
var t = this.ecModel;
return this.getShallow("color") || (!e && t ? t.get(hN) : null);
}, r.prototype.getFont = function() {
return by({
fontStyle: this.getShallow("fontStyle"),
fontWeight: this.getShallow("fontWeight"),
fontSize: this.getShallow("fontSize"),
fontFamily: this.getShallow("fontFamily")
}, this.ecModel);
}, r.prototype.getTextRect = function(e) {
for (var t = {
text: e,
verticalAlign: this.getShallow("verticalAlign") || this.getShallow("baseline")
}, n = 0; n < av.length; n++)
t[av[n]] = this.getShallow(av[n]);
return iv.useStyle(t), iv.update(), iv.getBoundingRect();
}, r;
}()
), lD = [
["lineWidth", "width"],
["stroke", "color"],
["opacity"],
["shadowBlur"],
["shadowOffsetX"],
["shadowOffsetY"],
["shadowColor"],
["lineDash", "type"],
["lineDashOffset", "dashOffset"],
["lineCap", "cap"],
["lineJoin", "join"],
["miterLimit"]
// Option decal is in `DecalObject` but style.decal is in `PatternObject`.
// So do not transfer decal directly.
], cN = wi(lD), vN = (
/** @class */
function() {
function r() {
}
return r.prototype.getLineStyle = function(e) {
return cN(this, e);
}, r;
}()
), uD = [
["fill", "color"],
["stroke", "borderColor"],
["lineWidth", "borderWidth"],
["opacity"],
["shadowBlur"],
["shadowOffsetX"],
["shadowOffsetY"],
["shadowColor"],
["lineDash", "borderType"],
["lineDashOffset", "borderDashOffset"],
["lineCap", "borderCap"],
["lineJoin", "borderJoin"],
["miterLimit", "borderMiterLimit"]
// Option decal is in `DecalObject` but style.decal is in `PatternObject`.
// So do not transfer decal directly.
], pN = wi(uD), dN = (
/** @class */
function() {
function r() {
}
return r.prototype.getItemStyle = function(e, t) {
return pN(this, e, t);
}, r;
}()
), It = (
/** @class */
function() {
function r(e, t, n) {
this.parentModel = t, this.ecModel = n, this.option = e;
}
return r.prototype.init = function(e, t, n) {
}, r.prototype.mergeOption = function(e, t) {
ht(this.option, e, !0);
}, r.prototype.get = function(e, t) {
return e == null ? this.option : this._doGet(this.parsePath(e), !t && this.parentModel);
}, r.prototype.getShallow = function(e, t) {
var n = this.option, a = n == null ? n : n[e];
if (a == null && !t) {
var i = this.parentModel;
i && (a = i.getShallow(e));
}
return a;
}, r.prototype.getModel = function(e, t) {
var n = e != null, a = n ? this.parsePath(e) : null, i = n ? this._doGet(a) : this.option;
return t = t || this.parentModel && this.parentModel.getModel(this.resolveParentPath(a)), new r(i, t, this.ecModel);
}, r.prototype.isEmpty = function() {
return this.option == null;
}, r.prototype.restoreData = function() {
}, r.prototype.clone = function() {
var e = this.constructor;
return new e(nt(this.option));
}, r.prototype.parsePath = function(e) {
return typeof e == "string" ? e.split(".") : e;
}, r.prototype.resolveParentPath = function(e) {
return e;
}, r.prototype.isAnimationEnabled = function() {
if (!yt.node && this.option) {
if (this.option.animation != null)
return !!this.option.animation;
if (this.parentModel)
return this.parentModel.isAnimationEnabled();
}
}, r.prototype._doGet = function(e, t) {
var n = this.option;
if (!e)
return n;
for (var a = 0; a < e.length && !(e[a] && (n = n && typeof n == "object" ? n[e[a]] : null, n == null)); a++)
;
return n == null && t && (n = t._doGet(this.resolveParentPath(e), t.parentModel)), n;
}, r;
}()
);
hy(It);
Tk(It);
ie(It, vN);
ie(It, dN);
ie(It, Ik);
ie(It, fN);
var gN = Math.round(Math.random() * 10);
function Ho(r) {
return [r || "", gN++].join("_");
}
function yN(r) {
var e = {};
r.registerSubTypeDefaulter = function(t, n) {
var a = jr(t);
e[a.main] = n;
}, r.determineSubType = function(t, n) {
var a = n.type;
if (!a) {
var i = jr(t).main;
r.hasSubTypes(t) && e[i] && (a = e[i](n));
}
return a;
};
}
function mN(r, e) {
r.topologicalTravel = function(i, o, s, l) {
if (!i.length)
return;
var u = t(o), h = u.graph, f = u.noEntryList, c = {};
for (A(i, function(m) {
c[m] = !0;
}); f.length; ) {
var v = f.pop(), p = h[v], d = !!c[v];
d && (s.call(l, v, p.originalDeps.slice()), delete c[v]), A(p.successor, d ? y : g);
}
A(c, function() {
var m = "";
throw process.env.NODE_ENV !== "production" && (m = Be("Circular dependency may exists: ", c, i, o)), new Error(m);
});
function g(m) {
h[m].entryCount--, h[m].entryCount === 0 && f.push(m);
}
function y(m) {
c[m] = !0, g(m);
}
};
function t(i) {
var o = {}, s = [];
return A(i, function(l) {
var u = n(o, l), h = u.originalDeps = e(l), f = a(h, i);
u.entryCount = f.length, u.entryCount === 0 && s.push(l), A(f, function(c) {
pt(u.predecessor, c) < 0 && u.predecessor.push(c);
var v = n(o, c);
pt(v.successor, c) < 0 && v.successor.push(l);
});
}), {
graph: o,
noEntryList: s
};
}
function n(i, o) {
return i[o] || (i[o] = {
predecessor: [],
successor: []
}), i[o];
}
function a(i, o) {
var s = [];
return A(i, function(l) {
pt(o, l) >= 0 && s.push(l);
}), s;
}
}
function _a(r, e) {
return ht(ht({}, r, !0), e, !0);
}
const _N = {
time: {
month: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
monthAbbr: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
dayOfWeek: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
dayOfWeekAbbr: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]
},
legend: {
selector: {
all: "All",
inverse: "Inv"
}
},
toolbox: {
brush: {
title: {
rect: "Box Select",
polygon: "Lasso Select",
lineX: "Horizontally Select",
lineY: "Vertically Select",
keep: "Keep Selections",
clear: "Clear Selections"
}
},
dataView: {
title: "Data View",
lang: ["Data View", "Close", "Refresh"]
},
dataZoom: {
title: {
zoom: "Zoom",
back: "Zoom Reset"
}
},
magicType: {
title: {
line: "Switch to Line Chart",
bar: "Switch to Bar Chart",
stack: "Stack",
tiled: "Tile"
}
},
restore: {
title: "Restore"
},
saveAsImage: {
title: "Save as Image",
lang: ["Right Click to Save Image"]
}
},
series: {
typeNames: {
pie: "Pie chart",
bar: "Bar chart",
line: "Line chart",
scatter: "Scatter plot",
effectScatter: "Ripple scatter plot",
radar: "Radar chart",
tree: "Tree",
treemap: "Treemap",
boxplot: "Boxplot",
candlestick: "Candlestick",
k: "K line chart",
heatmap: "Heat map",
map: "Map",
parallel: "Parallel coordinate map",
lines: "Line graph",
graph: "Relationship graph",
sankey: "Sankey diagram",
funnel: "Funnel chart",
gauge: "Gauge",
pictorialBar: "Pictorial bar",
themeRiver: "Theme River Map",
sunburst: "Sunburst",
custom: "Custom chart",
chart: "Chart"
}
},
aria: {
general: {
withTitle: 'This is a chart about "{title}"',
withoutTitle: "This is a chart"
},
series: {
single: {
prefix: "",
withName: " with type {seriesType} named {seriesName}.",
withoutName: " with type {seriesType}."
},
multiple: {
prefix: ". It consists of {seriesCount} series count.",
withName: " The {seriesId} series is a {seriesType} representing {seriesName}.",
withoutName: " The {seriesId} series is a {seriesType}.",
separator: {
middle: "",
end: ""
}
}
},
data: {
allData: "The data is as follows: ",
partialData: "The first {displayCnt} items are: ",
withName: "the data for {name} is {value}",
withoutName: "{value}",
separator: {
middle: ", ",
end: ". "
}
}
}
}, SN = {
time: {
month: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
monthAbbr: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"],
dayOfWeek: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"],
dayOfWeekAbbr: ["日", "一", "二", "三", "四", "五", "六"]
},
legend: {
selector: {
all: "全选",
inverse: "反选"
}
},
toolbox: {
brush: {
title: {
rect: "矩形选择",
polygon: "圈选",
lineX: "横向选择",
lineY: "纵向选择",
keep: "保持选择",
clear: "清除选择"
}
},
dataView: {
title: "数据视图",
lang: ["数据视图", "关闭", "刷新"]
},
dataZoom: {
title: {
zoom: "区域缩放",
back: "区域缩放还原"
}
},
magicType: {
title: {
line: "切换为折线图",
bar: "切换为柱状图",
stack: "切换为堆叠",
tiled: "切换为平铺"
}
},
restore: {
title: "还原"
},
saveAsImage: {
title: "保存为图片",
lang: ["右键另存为图片"]
}
},
series: {
typeNames: {
pie: "饼图",
bar: "柱状图",
line: "折线图",
scatter: "散点图",
effectScatter: "涟漪散点图",
radar: "雷达图",
tree: "树图",
treemap: "矩形树图",
boxplot: "箱型图",
candlestick: "K线图",
k: "K线图",
heatmap: "热力图",
map: "地图",
parallel: "平行坐标图",
lines: "线图",
graph: "关系图",
sankey: "桑基图",
funnel: "漏斗图",
gauge: "仪表盘图",
pictorialBar: "象形柱图",
themeRiver: "主题河流图",
sunburst: "旭日图",
custom: "自定义图表",
chart: "图表"
}
},
aria: {
general: {
withTitle: "这是一个关于“{title}”的图表。",
withoutTitle: "这是一个图表,"
},
series: {
single: {
prefix: "",
withName: "图表类型是{seriesType},表示{seriesName}。",
withoutName: "图表类型是{seriesType}。"
},
multiple: {
prefix: "它由{seriesCount}个图表系列组成。",
withName: "第{seriesId}个系列是一个表示{seriesName}的{seriesType},",
withoutName: "第{seriesId}个系列是一个{seriesType},",
separator: {
middle: ";",
end: "。"
}
}
},
data: {
allData: "其数据是——",
partialData: "其中,前{displayCnt}项是——",
withName: "{name}的数据是{value}",
withoutName: "{value}",
separator: {
middle: ",",
end: ""
}
}
}
};
var Wh = "ZH", wy = "EN", So = wy, dh = {}, Ty = {}, hD = yt.domSupported ? function() {
var r = (
/* eslint-disable-next-line */
(document.documentElement.lang || navigator.language || navigator.browserLanguage || So).toUpperCase()
);
return r.indexOf(Wh) > -1 ? Wh : So;
}() : So;
function fD(r, e) {
r = r.toUpperCase(), Ty[r] = new It(e), dh[r] = e;
}
function xN(r) {
if (U(r)) {
var e = dh[r.toUpperCase()] || {};
return r === Wh || r === wy ? nt(e) : ht(nt(e), nt(dh[So]), !1);
} else
return ht(nt(r), nt(dh[So]), !1);
}
function Pd(r) {
return Ty[r];
}
function bN() {
return Ty[So];
}
fD(wy, _N);
fD(Wh, SN);
var Cy = 1e3, Dy = Cy * 60, Js = Dy * 60, gr = Js * 24, E_ = gr * 365, Os = {
year: "{yyyy}",
month: "{MMM}",
day: "{d}",
hour: "{HH}:{mm}",
minute: "{HH}:{mm}",
second: "{HH}:{mm}:{ss}",
millisecond: "{HH}:{mm}:{ss} {SSS}",
none: "{yyyy}-{MM}-{dd} {HH}:{mm}:{ss} {SSS}"
}, Su = "{yyyy}-{MM}-{dd}", P_ = {
year: "{yyyy}",
month: "{yyyy}-{MM}",
day: Su,
hour: Su + " " + Os.hour,
minute: Su + " " + Os.minute,
second: Su + " " + Os.second,
millisecond: Os.none
}, ov = ["year", "month", "day", "hour", "minute", "second", "millisecond"], cD = ["year", "half-year", "quarter", "month", "week", "half-week", "day", "half-day", "quarter-day", "hour", "minute", "second", "millisecond"];
function Gn(r, e) {
return r += "", "0000".substr(0, e - r.length) + r;
}
function xo(r) {
switch (r) {
case "half-year":
case "quarter":
return "month";
case "week":
case "half-week":
return "day";
case "half-day":
case "quarter-day":
return "hour";
default:
return r;
}
}
function wN(r) {
return r === xo(r);
}
function TN(r) {
switch (r) {
case "year":
case "month":
return "day";
case "millisecond":
return "millisecond";
default:
return "second";
}
}
function Kf(r, e, t, n) {
var a = on(r), i = a[Ay(t)](), o = a[bo(t)]() + 1, s = Math.floor((o - 1) / 3) + 1, l = a[jf(t)](), u = a["get" + (t ? "UTC" : "") + "Day"](), h = a[vl(t)](), f = (h - 1) % 12 + 1, c = a[Qf(t)](), v = a[Jf(t)](), p = a[tc(t)](), d = h >= 12 ? "pm" : "am", g = d.toUpperCase(), y = n instanceof It ? n : Pd(n || hD) || bN(), m = y.getModel("time"), _ = m.get("month"), S = m.get("monthAbbr"), x = m.get("dayOfWeek"), b = m.get("dayOfWeekAbbr");
return (e || "").replace(/{a}/g, d + "").replace(/{A}/g, g + "").replace(/{yyyy}/g, i + "").replace(/{yy}/g, Gn(i % 100 + "", 2)).replace(/{Q}/g, s + "").replace(/{MMMM}/g, _[o - 1]).replace(/{MMM}/g, S[o - 1]).replace(/{MM}/g, Gn(o, 2)).replace(/{M}/g, o + "").replace(/{dd}/g, Gn(l, 2)).replace(/{d}/g, l + "").replace(/{eeee}/g, x[u]).replace(/{ee}/g, b[u]).replace(/{e}/g, u + "").replace(/{HH}/g, Gn(h, 2)).replace(/{H}/g, h + "").replace(/{hh}/g, Gn(f + "", 2)).replace(/{h}/g, f + "").replace(/{mm}/g, Gn(c, 2)).replace(/{m}/g, c + "").replace(/{ss}/g, Gn(v, 2)).replace(/{s}/g, v + "").replace(/{SSS}/g, Gn(p, 3)).replace(/{S}/g, p + "");
}
function CN(r, e, t, n, a) {
var i = null;
if (U(t))
i = t;
else if (K(t))
i = t(r.value, e, {
level: r.level
});
else {
var o = B({}, Os);
if (r.level > 0)
for (var s = 0; s < ov.length; ++s)
o[ov[s]] = "{primary|" + o[ov[s]] + "}";
var l = t ? t.inherit === !1 ? t : et(t, o) : o, u = vD(r.value, a);
if (l[u])
i = l[u];
else if (l.inherit) {
for (var h = cD.indexOf(u), s = h - 1; s >= 0; --s)
if (l[u]) {
i = l[u];
break;
}
i = i || o.none;
}
if (z(i)) {
var f = r.level == null ? 0 : r.level >= 0 ? r.level : i.length + r.level;
f = Math.min(f, i.length - 1), i = i[f];
}
}
return Kf(new Date(r.value), i, a, n);
}
function vD(r, e) {
var t = on(r), n = t[bo(e)]() + 1, a = t[jf(e)](), i = t[vl(e)](), o = t[Qf(e)](), s = t[Jf(e)](), l = t[tc(e)](), u = l === 0, h = u && s === 0, f = h && o === 0, c = f && i === 0, v = c && a === 1, p = v && n === 1;
return p ? "year" : v ? "month" : c ? "day" : f ? "hour" : h ? "minute" : u ? "second" : "millisecond";
}
function k_(r, e, t) {
var n = Tt(r) ? on(r) : r;
switch (e = e || vD(r, t), e) {
case "year":
return n[Ay(t)]();
case "half-year":
return n[bo(t)]() >= 6 ? 1 : 0;
case "quarter":
return Math.floor((n[bo(t)]() + 1) / 4);
case "month":
return n[bo(t)]();
case "day":
return n[jf(t)]();
case "half-day":
return n[vl(t)]() / 24;
case "hour":
return n[vl(t)]();
case "minute":
return n[Qf(t)]();
case "second":
return n[Jf(t)]();
case "millisecond":
return n[tc(t)]();
}
}
function Ay(r) {
return r ? "getUTCFullYear" : "getFullYear";
}
function bo(r) {
return r ? "getUTCMonth" : "getMonth";
}
function jf(r) {
return r ? "getUTCDate" : "getDate";
}
function vl(r) {
return r ? "getUTCHours" : "getHours";
}
function Qf(r) {
return r ? "getUTCMinutes" : "getMinutes";
}
function Jf(r) {
return r ? "getUTCSeconds" : "getSeconds";
}
function tc(r) {
return r ? "getUTCMilliseconds" : "getMilliseconds";
}
function DN(r) {
return r ? "setUTCFullYear" : "setFullYear";
}
function pD(r) {
return r ? "setUTCMonth" : "setMonth";
}
function dD(r) {
return r ? "setUTCDate" : "setDate";
}
function gD(r) {
return r ? "setUTCHours" : "setHours";
}
function yD(r) {
return r ? "setUTCMinutes" : "setMinutes";
}
function mD(r) {
return r ? "setUTCSeconds" : "setSeconds";
}
function _D(r) {
return r ? "setUTCMilliseconds" : "setMilliseconds";
}
function SD(r) {
if (!sy(r))
return U(r) ? r : "-";
var e = (r + "").split(".");
return e[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g, "$1,") + (e.length > 1 ? "." + e[1] : "");
}
function xD(r, e) {
return r = (r || "").toLowerCase().replace(/-(.)/g, function(t, n) {
return n.toUpperCase();
}), e && r && (r = r.charAt(0).toUpperCase() + r.slice(1)), r;
}
var Wo = ty;
function kd(r, e, t) {
var n = "{yyyy}-{MM}-{dd} {HH}:{mm}:{ss}";
function a(h) {
return h && Ir(h) ? h : "-";
}
function i(h) {
return !!(h != null && !isNaN(h) && isFinite(h));
}
var o = e === "time", s = r instanceof Date;
if (o || s) {
var l = o ? on(r) : r;
if (isNaN(+l)) {
if (s)
return "-";
} else return Kf(l, n, t);
}
if (e === "ordinal")
return Mh(r) ? a(r) : Tt(r) && i(r) ? r + "" : "-";
var u = An(r);
return i(u) ? SD(u) : Mh(r) ? a(r) : typeof r == "boolean" ? r + "" : "-";
}
var R_ = ["a", "b", "c", "d", "e", "f", "g"], sv = function(r, e) {
return "{" + r + (e ?? "") + "}";
};
function bD(r, e, t) {
z(e) || (e = [e]);
var n = e.length;
if (!n)
return "";
for (var a = e[0].$vars || [], i = 0; i < a.length; i++) {
var o = R_[i];
r = r.replace(sv(o), sv(o, 0));
}
for (var s = 0; s < n; s++)
for (var l = 0; l < a.length; l++) {
var u = e[s][a[l]];
r = r.replace(sv(R_[l], s), t ? ke(u) : u);
}
return r;
}
function AN(r, e, t) {
return A(e, function(n, a) {
r = r.replace("{" + a + "}", n);
}), r;
}
function MN(r, e) {
var t = U(r) ? {
color: r,
extraCssText: e
} : r || {}, n = t.color, a = t.type;
e = t.extraCssText;
var i = t.renderMode || "html";
if (!n)
return "";
if (i === "html")
return a === "subItem" ? '<span style="display:inline-block;vertical-align:middle;margin-right:8px;margin-left:3px;border-radius:4px;width:4px;height:4px;background-color:' + ke(n) + ";" + (e || "") + '"></span>' : '<span style="display:inline-block;margin-right:4px;border-radius:10px;width:10px;height:10px;background-color:' + ke(n) + ";" + (e || "") + '"></span>';
var o = t.markerId || "markerX";
return {
renderMode: i,
content: "{" + o + "|} ",
style: a === "subItem" ? {
width: 4,
height: 4,
borderRadius: 2,
backgroundColor: n
} : {
width: 10,
height: 10,
borderRadius: 5,
backgroundColor: n
}
};
}
function Ci(r, e) {
return e = e || "transparent", U(r) ? r : J(r) && r.colorStops && (r.colorStops[0] || {}).color || e;
}
function $h(r, e) {
if (e === "_blank" || e === "blank") {
var t = window.open();
t.opener = null, t.location.href = r;
} else
window.open(r, e);
}
var gh = A, wD = ["left", "right", "top", "bottom", "width", "height"], ai = [["width", "left", "right"], ["height", "top", "bottom"]];
function My(r, e, t, n, a) {
var i = 0, o = 0;
n == null && (n = 1 / 0), a == null && (a = 1 / 0);
var s = 0;
e.eachChild(function(l, u) {
var h = l.getBoundingRect(), f = e.childAt(u + 1), c = f && f.getBoundingRect(), v, p;
if (r === "horizontal") {
var d = h.width + (c ? -c.x + h.x : 0);
v = i + d, v > n || l.newline ? (i = 0, v = d, o += s + t, s = h.height) : s = Math.max(s, h.height);
} else {
var g = h.height + (c ? -c.y + h.y : 0);
p = o + g, p > a || l.newline ? (i += s + t, o = 0, p = g, s = h.width) : s = Math.max(s, h.width);
}
l.newline || (l.x = i, l.y = o, l.markRedraw(), r === "horizontal" ? i = v + t : o = p + t);
});
}
var di = My;
ut(My, "vertical");
ut(My, "horizontal");
function IN(r, e, t) {
var n = e.width, a = e.height, i = W(r.left, n), o = W(r.top, a), s = W(r.right, n), l = W(r.bottom, a);
return (isNaN(i) || isNaN(parseFloat(r.left))) && (i = 0), (isNaN(s) || isNaN(parseFloat(r.right))) && (s = n), (isNaN(o) || isNaN(parseFloat(r.top))) && (o = 0), (isNaN(l) || isNaN(parseFloat(r.bottom))) && (l = a), t = Wo(t || 0), {
width: Math.max(s - i - t[1] - t[3], 0),
height: Math.max(l - o - t[0] - t[2], 0)
};
}
function se(r, e, t) {
t = Wo(t || 0);
var n = e.width, a = e.height, i = W(r.left, n), o = W(r.top, a), s = W(r.right, n), l = W(r.bottom, a), u = W(r.width, n), h = W(r.height, a), f = t[2] + t[0], c = t[1] + t[3], v = r.aspect;
switch (isNaN(u) && (u = n - s - c - i), isNaN(h) && (h = a - l - f - o), v != null && (isNaN(u) && isNaN(h) && (v > n / a ? u = n * 0.8 : h = a * 0.8), isNaN(u) && (u = v * h), isNaN(h) && (h = u / v)), isNaN(i) && (i = n - s - u - c), isNaN(o) && (o = a - l - h - f), r.left || r.right) {
case "center":
i = n / 2 - u / 2 - t[3];
break;
case "right":
i = n - u - c;
break;
}
switch (r.top || r.bottom) {
case "middle":
case "center":
o = a / 2 - h / 2 - t[0];
break;
case "bottom":
o = a - h - f;
break;
}
i = i || 0, o = o || 0, isNaN(u) && (u = n - c - i - (s || 0)), isNaN(h) && (h = a - f - o - (l || 0));
var p = new ct(i + t[3], o + t[0], u, h);
return p.margin = t, p;
}
function ec(r, e, t, n, a, i) {
var o = !a || !a.hv || a.hv[0], s = !a || !a.hv || a.hv[1], l = a && a.boundingMode || "all";
if (i = i || r, i.x = r.x, i.y = r.y, !o && !s)
return !1;
var u;
if (l === "raw")
u = r.type === "group" ? new ct(0, 0, +e.width || 0, +e.height || 0) : r.getBoundingRect();
else if (u = r.getBoundingRect(), r.needLocalTransform()) {
var h = r.getLocalTransform();
u = u.clone(), u.applyTransform(h);
}
var f = se(et({
width: u.width,
height: u.height
}, e), t, n), c = o ? f.x - u.x : 0, v = s ? f.y - u.y : 0;
return l === "raw" ? (i.x = c, i.y = v) : (i.x += c, i.y += v), i === r && r.markRedraw(), !0;
}
function LN(r, e) {
return r[ai[e][0]] != null || r[ai[e][1]] != null && r[ai[e][2]] != null;
}
function pl(r) {
var e = r.layoutMode || r.constructor.layoutMode;
return J(e) ? e : e ? {
type: e
} : null;
}
function pa(r, e, t) {
var n = t && t.ignoreSize;
!z(n) && (n = [n, n]);
var a = o(ai[0], 0), i = o(ai[1], 1);
u(ai[0], r, a), u(ai[1], r, i);
function o(h, f) {
var c = {}, v = 0, p = {}, d = 0, g = 2;
if (gh(h, function(_) {
p[_] = r[_];
}), gh(h, function(_) {
s(e, _) && (c[_] = p[_] = e[_]), l(c, _) && v++, l(p, _) && d++;
}), n[f])
return l(e, h[1]) ? p[h[2]] = null : l(e, h[2]) && (p[h[1]] = null), p;
if (d === g || !v)
return p;
if (v >= g)
return c;
for (var y = 0; y < h.length; y++) {
var m = h[y];
if (!s(c, m) && s(r, m)) {
c[m] = r[m];
break;
}
}
return c;
}
function s(h, f) {
return h.hasOwnProperty(f);
}
function l(h, f) {
return h[f] != null && h[f] !== "auto";
}
function u(h, f, c) {
gh(h, function(v) {
f[v] = c[v];
});
}
}
function $o(r) {
return TD({}, r);
}
function TD(r, e) {
return e && r && gh(wD, function(t) {
e.hasOwnProperty(t) && (r[t] = e[t]);
}), r;
}
var EN = bt(), _t = (
/** @class */
function(r) {
O(e, r);
function e(t, n, a) {
var i = r.call(this, t, n, a) || this;
return i.uid = Ho("ec_cpt_model"), i;
}
return e.prototype.init = function(t, n, a) {
this.mergeDefaultAndTheme(t, a);
}, e.prototype.mergeDefaultAndTheme = function(t, n) {
var a = pl(this), i = a ? $o(t) : {}, o = n.getTheme();
ht(t, o.get(this.mainType)), ht(t, this.getDefaultOption()), a && pa(t, i, a);
}, e.prototype.mergeOption = function(t, n) {
ht(this.option, t, !0);
var a = pl(this);
a && pa(this.option, t, a);
}, e.prototype.optionUpdated = function(t, n) {
}, e.prototype.getDefaultOption = function() {
var t = this.constructor;
if (!xk(t))
return t.defaultOption;
var n = EN(this);
if (!n.defaultOption) {
for (var a = [], i = t; i; ) {
var o = i.prototype.defaultOption;
o && a.push(o), i = i.superClass;
}
for (var s = {}, l = a.length - 1; l >= 0; l--)
s = ht(s, a[l], !0);
n.defaultOption = s;
}
return n.defaultOption;
}, e.prototype.getReferringComponents = function(t, n) {
var a = t + "Index", i = t + "Id";
return Ol(this.ecModel, t, {
index: this.get(a, !0),
id: this.get(i, !0)
}, n);
}, e.prototype.getBoxLayoutParams = function() {
var t = this;
return {
left: t.get("left"),
top: t.get("top"),
right: t.get("right"),
bottom: t.get("bottom"),
width: t.get("width"),
height: t.get("height")
};
}, e.prototype.getZLevelKey = function() {
return "";
}, e.prototype.setZLevel = function(t) {
this.option.zlevel = t;
}, e.protoInitialize = function() {
var t = e.prototype;
t.type = "component", t.id = "", t.name = "", t.mainType = "", t.subType = "", t.componentIndex = 0;
}(), e;
}(It)
);
CC(_t, It);
zf(_t);
yN(_t);
mN(_t, PN);
function PN(r) {
var e = [];
return A(_t.getClassesByMainType(r), function(t) {
e = e.concat(t.dependencies || t.prototype.dependencies || []);
}), e = G(e, function(t) {
return jr(t).main;
}), r !== "dataset" && pt(e, "dataset") <= 0 && e.unshift("dataset"), e;
}
var CD = "";
typeof navigator < "u" && (CD = navigator.platform || "");
var Ui = "rgba(0, 0, 0, 0.2)";
const kN = {
darkMode: "auto",
// backgroundColor: 'rgba(0,0,0,0)',
colorBy: "series",
color: ["#5470c6", "#91cc75", "#fac858", "#ee6666", "#73c0de", "#3ba272", "#fc8452", "#9a60b4", "#ea7ccc"],
gradientColor: ["#f6efa6", "#d88273", "#bf444c"],
aria: {
decal: {
decals: [{
color: Ui,
dashArrayX: [1, 0],
dashArrayY: [2, 5],
symbolSize: 1,
rotation: Math.PI / 6
}, {
color: Ui,
symbol: "circle",
dashArrayX: [[8, 8], [0, 8, 8, 0]],
dashArrayY: [6, 0],
symbolSize: 0.8
}, {
color: Ui,
dashArrayX: [1, 0],
dashArrayY: [4, 3],
rotation: -Math.PI / 4
}, {
color: Ui,
dashArrayX: [[6, 6], [0, 6, 6, 0]],
dashArrayY: [6, 0]
}, {
color: Ui,
dashArrayX: [[1, 0], [1, 6]],
dashArrayY: [1, 0, 6, 0],
rotation: Math.PI / 4
}, {
color: Ui,
symbol: "triangle",
dashArrayX: [[9, 9], [0, 9, 9, 0]],
dashArrayY: [7, 2],
symbolSize: 0.75
}]
}
},
// If xAxis and yAxis declared, grid is created by default.
// grid: {},
textStyle: {
// color: '#000',
// decoration: 'none',
// PENDING
fontFamily: CD.match(/^Win/) ? "Microsoft YaHei" : "sans-serif",
// fontFamily: 'Arial, Verdana, sans-serif',
fontSize: 12,
fontStyle: "normal",
fontWeight: "normal"
},
// http://blogs.adobe.com/webplatform/2014/02/24/using-blend-modes-in-html-canvas/
// https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/globalCompositeOperation
// Default is source-over
blendMode: null,
stateAnimation: {
duration: 300,
easing: "cubicOut"
},
animation: "auto",
animationDuration: 1e3,
animationDurationUpdate: 500,
animationEasing: "cubicInOut",
animationEasingUpdate: "cubicInOut",
animationThreshold: 2e3,
// Configuration for progressive/incremental rendering
progressiveThreshold: 3e3,
progressive: 400,
// Threshold of if use single hover layer to optimize.
// It is recommended that `hoverLayerThreshold` is equivalent to or less than
// `progressiveThreshold`, otherwise hover will cause restart of progressive,
// which is unexpected.
// see example <echarts/test/heatmap-large.html>.
hoverLayerThreshold: 3e3,
// See: module:echarts/scale/Time
useUTC: !1
};
var Rd = X(["tooltip", "label", "itemName", "itemId", "itemGroupId", "itemChildGroupId", "seriesName"]), br = "original", Ae = "arrayRows", wr = "objectRows", ln = "keyedColumns", wn = "typedArray", DD = "unknown", en = "column", Uo = "row", ye = {
Must: 1,
Might: 2,
Not: 3
// Other cases
}, AD = bt();
function RN(r) {
AD(r).datasetMap = X();
}
function MD(r, e, t) {
var n = {}, a = Ly(e);
if (!a || !r)
return n;
var i = [], o = [], s = e.ecModel, l = AD(s).datasetMap, u = a.uid + "_" + t.seriesLayoutBy, h, f;
r = r.slice(), A(r, function(d, g) {
var y = J(d) ? d : r[g] = {
name: d
};
y.type === "ordinal" && h == null && (h = g, f = p(y)), n[y.name] = [];
});
var c = l.get(u) || l.set(u, {
categoryWayDim: f,
valueWayDim: 0
});
A(r, function(d, g) {
var y = d.name, m = p(d);
if (h == null) {
var _ = c.valueWayDim;
v(n[y], _, m), v(o, _, m), c.valueWayDim += m;
} else if (h === g)
v(n[y], 0, m), v(i, 0, m);
else {
var _ = c.categoryWayDim;
v(n[y], _, m), v(o, _, m), c.categoryWayDim += m;
}
});
function v(d, g, y) {
for (var m = 0; m < y; m++)
d.push(g + m);
}
function p(d) {
var g = d.dimsDef;
return g ? g.length : 1;
}
return i.length && (n.itemName = i), o.length && (n.seriesName = o), n;
}
function Iy(r, e, t) {
var n = {}, a = Ly(r);
if (!a)
return n;
var i = e.sourceFormat, o = e.dimensionsDefine, s;
(i === wr || i === ln) && A(o, function(h, f) {
(J(h) ? h.name : h) === "name" && (s = f);
});
var l = function() {
for (var h = {}, f = {}, c = [], v = 0, p = Math.min(5, t); v < p; v++) {
var d = LD(e.data, i, e.seriesLayoutBy, o, e.startIndex, v);
c.push(d);
var g = d === ye.Not;
if (g && h.v == null && v !== s && (h.v = v), (h.n == null || h.n === h.v || !g && c[h.n] === ye.Not) && (h.n = v), y(h) && c[h.n] !== ye.Not)
return h;
g || (d === ye.Might && f.v == null && v !== s && (f.v = v), (f.n == null || f.n === f.v) && (f.n = v));
}
function y(m) {
return m.v != null && m.n != null;
}
return y(h) ? h : y(f) ? f : null;
}();
if (l) {
n.value = [l.v];
var u = s ?? l.n;
n.itemName = [u], n.seriesName = [u];
}
return n;
}
function Ly(r) {
var e = r.get("data", !0);
if (!e)
return Ol(r.ecModel, "dataset", {
index: r.get("datasetIndex", !0),
id: r.get("datasetId", !0)
}, ne).models[0];
}
function NN(r) {
return !r.get("transform", !0) && !r.get("fromTransformResult", !0) ? [] : Ol(r.ecModel, "dataset", {
index: r.get("fromDatasetIndex", !0),
id: r.get("fromDatasetId", !0)
}, ne).models;
}
function ID(r, e) {
return LD(r.data, r.sourceFormat, r.seriesLayoutBy, r.dimensionsDefine, r.startIndex, e);
}
function LD(r, e, t, n, a, i) {
var o, s = 5;
if (Ve(r))
return ye.Not;
var l, u;
if (n) {
var h = n[i];
J(h) ? (l = h.name, u = h.type) : U(h) && (l = h);
}
if (u != null)
return u === "ordinal" ? ye.Must : ye.Not;
if (e === Ae) {
var f = r;
if (t === Uo) {
for (var c = f[i], v = 0; v < (c || []).length && v < s; v++)
if ((o = S(c[a + v])) != null)
return o;
} else
for (var v = 0; v < f.length && v < s; v++) {
var p = f[a + v];
if (p && (o = S(p[i])) != null)
return o;
}
} else if (e === wr) {
var d = r;
if (!l)
return ye.Not;
for (var v = 0; v < d.length && v < s; v++) {
var g = d[v];
if (g && (o = S(g[l])) != null)
return o;
}
} else if (e === ln) {
var y = r;
if (!l)
return ye.Not;
var c = y[l];
if (!c || Ve(c))
return ye.Not;
for (var v = 0; v < c.length && v < s; v++)
if ((o = S(c[v])) != null)
return o;
} else if (e === br)
for (var m = r, v = 0; v < m.length && v < s; v++) {
var g = m[v], _ = Bo(g);
if (!z(_))
return ye.Not;
if ((o = S(_[i])) != null)
return o;
}
function S(x) {
var b = U(x);
if (x != null && Number.isFinite(Number(x)) && x !== "")
return b ? ye.Might : ye.Not;
if (b && x !== "-")
return ye.Must;
}
return ye.Not;
}
var Nd = X();
function ON(r, e) {
tt(Nd.get(r) == null && e), Nd.set(r, e);
}
function VN(r, e, t) {
var n = Nd.get(e);
if (!n)
return t;
var a = n(r);
if (!a)
return t;
if (process.env.NODE_ENV !== "production")
for (var i = 0; i < a.length; i++)
tt(To(a[i]));
return t.concat(a);
}
var N_ = bt(), BN = bt(), Ey = (
/** @class */
function() {
function r() {
}
return r.prototype.getColorFromPalette = function(e, t, n) {
var a = Pt(this.get("color", !0)), i = this.get("colorLayer", !0);
return ED(this, N_, a, i, e, t, n);
}, r.prototype.clearColorPalette = function() {
GN(this, N_);
}, r;
}()
);
function Od(r, e, t, n) {
var a = Pt(r.get(["aria", "decal", "decals"]));
return ED(r, BN, a, null, e, t, n);
}
function zN(r, e) {
for (var t = r.length, n = 0; n < t; n++)
if (r[n].length > e)
return r[n];
return r[t - 1];
}
function ED(r, e, t, n, a, i, o) {
i = i || r;
var s = e(i), l = s.paletteIdx || 0, u = s.paletteNameMap = s.paletteNameMap || {};
if (u.hasOwnProperty(a))
return u[a];
var h = o == null || !n ? t : zN(n, o);
if (h = h || t, !(!h || !h.length)) {
var f = h[l];
return a && (u[a] = f), s.paletteIdx = (l + 1) % h.length, f;
}
}
function GN(r, e) {
e(r).paletteIdx = 0, e(r).paletteNameMap = {};
}
var xu, us, O_, lv = "\0_ec_inner", V_ = 1, FN = {
grid: "GridComponent",
polar: "PolarComponent",
geo: "GeoComponent",
singleAxis: "SingleAxisComponent",
parallel: "ParallelComponent",
calendar: "CalendarComponent",
graphic: "GraphicComponent",
toolbox: "ToolboxComponent",
tooltip: "TooltipComponent",
axisPointer: "AxisPointerComponent",
brush: "BrushComponent",
title: "TitleComponent",
timeline: "TimelineComponent",
markPoint: "MarkPointComponent",
markLine: "MarkLineComponent",
markArea: "MarkAreaComponent",
legend: "LegendComponent",
dataZoom: "DataZoomComponent",
visualMap: "VisualMapComponent",
// aria: 'AriaComponent',
// dataset: 'DatasetComponent',
// Dependencies
xAxis: "GridComponent",
yAxis: "GridComponent",
angleAxis: "PolarComponent",
radiusAxis: "PolarComponent"
}, HN = {
line: "LineChart",
bar: "BarChart",
pie: "PieChart",
scatter: "ScatterChart",
radar: "RadarChart",
map: "MapChart",
tree: "TreeChart",
treemap: "TreemapChart",
graph: "GraphChart",
gauge: "GaugeChart",
funnel: "FunnelChart",
parallel: "ParallelChart",
sankey: "SankeyChart",
boxplot: "BoxplotChart",
candlestick: "CandlestickChart",
effectScatter: "EffectScatterChart",
lines: "LinesChart",
heatmap: "HeatmapChart",
pictorialBar: "PictorialBarChart",
themeRiver: "ThemeRiverChart",
sunburst: "SunburstChart",
custom: "CustomChart"
}, Uh = {};
function WN(r) {
A(r, function(e, t) {
if (!_t.hasClass(t)) {
var n = FN[t];
n && !Uh[n] && (_e("Component " + t + ` is used but not imported.
import { ` + n + ` } from 'echarts/components';
echarts.use([` + n + "]);"), Uh[n] = !0);
}
});
}
var Py = (
/** @class */
function(r) {
O(e, r);
function e() {
return r !== null && r.apply(this, arguments) || this;
}
return e.prototype.init = function(t, n, a, i, o, s) {
i = i || {}, this.option = null, this._theme = new It(i), this._locale = new It(o), this._optionManager = s;
}, e.prototype.setOption = function(t, n, a) {
process.env.NODE_ENV !== "production" && (tt(t != null, "option is null/undefined"), tt(t[lv] !== V_, "please use chart.getOption()"));
var i = G_(n);
this._optionManager.setOption(t, a, i), this._resetOption(null, i);
}, e.prototype.resetOption = function(t, n) {
return this._resetOption(t, G_(n));
}, e.prototype._resetOption = function(t, n) {
var a = !1, i = this._optionManager;
if (!t || t === "recreate") {
var o = i.mountOption(t === "recreate");
process.env.NODE_ENV !== "production" && WN(o), !this.option || t === "recreate" ? O_(this, o) : (this.restoreData(), this._mergeOption(o, n)), a = !0;
}
if ((t === "timeline" || t === "media") && this.restoreData(), !t || t === "recreate" || t === "timeline") {
var s = i.getTimelineOption(this);
s && (a = !0, this._mergeOption(s, n));
}
if (!t || t === "recreate" || t === "media") {
var l = i.getMediaOption(this);
l.length && A(l, function(u) {
a = !0, this._mergeOption(u, n);
}, this);
}
return a;
}, e.prototype.mergeOption = function(t) {
this._mergeOption(t, null);
}, e.prototype._mergeOption = function(t, n) {
var a = this.option, i = this._componentsMap, o = this._componentsCount, s = [], l = X(), u = n && n.replaceMergeMainTypeMap;
RN(this), A(t, function(f, c) {
f != null && (_t.hasClass(c) ? c && (s.push(c), l.set(c, !0)) : a[c] = a[c] == null ? nt(f) : ht(a[c], f, !0));
}), u && u.each(function(f, c) {
_t.hasClass(c) && !l.get(c) && (s.push(c), l.set(c, !0));
}), _t.topologicalTravel(s, _t.getAllClassMainTypes(), h, this);
function h(f) {
var c = VN(this, f, Pt(t[f])), v = i.get(f), p = (
// `!oldCmptList` means init. See the comment in `mappingToExists`
v ? u && u.get(f) ? "replaceMerge" : "normalMerge" : "replaceAll"
), d = SC(v, c, p);
ck(d, f, _t), a[f] = null, i.set(f, null), o.set(f, 0);
var g = [], y = [], m = 0, _, S;
A(d, function(x, b) {
var w = x.existing, T = x.newOption;
if (!T)
w && (w.mergeOption({}, this), w.optionUpdated({}, !1));
else {
var C = f === "series", D = _t.getClass(
f,
x.keyInfo.subType,
!C
// Give a more detailed warn later if series don't exists
);
if (!D) {
if (process.env.NODE_ENV !== "production") {
var M = x.keyInfo.subType, I = HN[M];
Uh[M] || (Uh[M] = !0, _e(I ? "Series " + M + ` is used but not imported.
import { ` + I + ` } from 'echarts/charts';
echarts.use([` + I + "]);" : "Unknown series " + M));
}
return;
}
if (f === "tooltip") {
if (_) {
process.env.NODE_ENV !== "production" && (S || (Zt("Currently only one tooltip component is allowed."), S = !0));
return;
}
_ = !0;
}
if (w && w.constructor === D)
w.name = x.keyInfo.name, w.mergeOption(T, this), w.optionUpdated(T, !1);
else {
var L = B({
componentIndex: b
}, x.keyInfo);
w = new D(T, this, this, L), B(w, L), x.brandNew && (w.__requireNewView = !0), w.init(T, this, this), w.optionUpdated(null, !0);
}
}
w ? (g.push(w.option), y.push(w), m++) : (g.push(void 0), y.push(void 0));
}, this), a[f] = g, i.set(f, y), o.set(f, m), f === "series" && xu(this);
}
this._seriesIndices || xu(this);
}, e.prototype.getOption = function() {
var t = nt(this.option);
return A(t, function(n, a) {
if (_t.hasClass(a)) {
for (var i = Pt(n), o = i.length, s = !1, l = o - 1; l >= 0; l--)
i[l] && !To(i[l]) ? s = !0 : (i[l] = null, !s && o--);
i.length = o, t[a] = i;
}
}), delete t[lv], t;
}, e.prototype.getTheme = function() {
return this._theme;
}, e.prototype.getLocaleModel = function() {
return this._locale;
}, e.prototype.setUpdatePayload = function(t) {
this._payload = t;
}, e.prototype.getUpdatePayload = function() {
return this._payload;
}, e.prototype.getComponent = function(t, n) {
var a = this._componentsMap.get(t);
if (a) {
var i = a[n || 0];
if (i)
return i;
if (n == null) {
for (var o = 0; o < a.length; o++)
if (a[o])
return a[o];
}
}
}, e.prototype.queryComponents = function(t) {
var n = t.mainType;
if (!n)
return [];
var a = t.index, i = t.id, o = t.name, s = this._componentsMap.get(n);
if (!s || !s.length)
return [];
var l;
return a != null ? (l = [], A(Pt(a), function(u) {
s[u] && l.push(s[u]);
})) : i != null ? l = B_("id", i, s) : o != null ? l = B_("name", o, s) : l = At(s, function(u) {
return !!u;
}), z_(l, t);
}, e.prototype.findComponents = function(t) {
var n = t.query, a = t.mainType, i = s(n), o = i ? this.queryComponents(i) : At(this._componentsMap.get(a), function(u) {
return !!u;
});
return l(z_(o, t));
function s(u) {
var h = a + "Index", f = a + "Id", c = a + "Name";
return u && (u[h] != null || u[f] != null || u[c] != null) ? {
mainType: a,
// subType will be filtered finally.
index: u[h],
id: u[f],
name: u[c]
} : null;
}
function l(u) {
return t.filter ? At(u, t.filter) : u;
}
}, e.prototype.eachComponent = function(t, n, a) {
var i = this._componentsMap;
if (K(t)) {
var o = n, s = t;
i.each(function(f, c) {
for (var v = 0; f && v < f.length; v++) {
var p = f[v];
p && s.call(o, c, p, p.componentIndex);
}
});
} else
for (var l = U(t) ? i.get(t) : J(t) ? this.findComponents(t) : null, u = 0; l && u < l.length; u++) {
var h = l[u];
h && n.call(a, h, h.componentIndex);
}
}, e.prototype.getSeriesByName = function(t) {
var n = oe(t, null);
return At(this._componentsMap.get("series"), function(a) {
return !!a && n != null && a.name === n;
});
}, e.prototype.getSeriesByIndex = function(t) {
return this._componentsMap.get("series")[t];
}, e.prototype.getSeriesByType = function(t) {
return At(this._componentsMap.get("series"), function(n) {
return !!n && n.subType === t;
});
}, e.prototype.getSeries = function() {
return At(this._componentsMap.get("series"), function(t) {
return !!t;
});
}, e.prototype.getSeriesCount = function() {
return this._componentsCount.get("series");
}, e.prototype.eachSeries = function(t, n) {
us(this), A(this._seriesIndices, function(a) {
var i = this._componentsMap.get("series")[a];
t.call(n, i, a);
}, this);
}, e.prototype.eachRawSeries = function(t, n) {
A(this._componentsMap.get("series"), function(a) {
a && t.call(n, a, a.componentIndex);
});
}, e.prototype.eachSeriesByType = function(t, n, a) {
us(this), A(this._seriesIndices, function(i) {
var o = this._componentsMap.get("series")[i];
o.subType === t && n.call(a, o, i);
}, this);
}, e.prototype.eachRawSeriesByType = function(t, n, a) {
return A(this.getSeriesByType(t), n, a);
}, e.prototype.isSeriesFiltered = function(t) {
return us(this), this._seriesIndicesMap.get(t.componentIndex) == null;
}, e.prototype.getCurrentSeriesIndices = function() {
return (this._seriesIndices || []).slice();
}, e.prototype.filterSeries = function(t, n) {
us(this);
var a = [];
A(this._seriesIndices, function(i) {
var o = this._componentsMap.get("series")[i];
t.call(n, o, i) && a.push(i);
}, this), this._seriesIndices = a, this._seriesIndicesMap = X(a);
}, e.prototype.restoreData = function(t) {
xu(this);
var n = this._componentsMap, a = [];
n.each(function(i, o) {
_t.hasClass(o) && a.push(o);
}), _t.topologicalTravel(a, _t.getAllClassMainTypes(), function(i) {
A(n.get(i), function(o) {
o && (i !== "series" || !$N(o, t)) && o.restoreData();
});
});
}, e.internalField = function() {
xu = function(t) {
var n = t._seriesIndices = [];
A(t._componentsMap.get("series"), function(a) {
a && n.push(a.componentIndex);
}), t._seriesIndicesMap = X(n);
}, us = function(t) {
if (process.env.NODE_ENV !== "production" && !t._seriesIndices)
throw new Error("Option should contains series.");
}, O_ = function(t, n) {
t.option = {}, t.option[lv] = V_, t._componentsMap = X({
series: []
}), t._componentsCount = X();
var a = n.aria;
J(a) && a.enabled == null && (a.enabled = !0), UN(n, t._theme.option), ht(n, kN, !1), t._mergeOption(n, null);
};
}(), e;
}(It)
);
function $N(r, e) {
if (e) {
var t = e.seriesIndex, n = e.seriesId, a = e.seriesName;
return t != null && r.componentIndex !== t || n != null && r.id !== n || a != null && r.name !== a;
}
}
function UN(r, e) {
var t = r.color && !r.colorLayer;
A(e, function(n, a) {
a === "colorLayer" && t || _t.hasClass(a) || (typeof n == "object" ? r[a] = r[a] ? ht(r[a], n, !1) : nt(n) : r[a] == null && (r[a] = n));
});
}
function B_(r, e, t) {
if (z(e)) {
var n = X();
return A(e, function(i) {
if (i != null) {
var o = oe(i, null);
o != null && n.set(i, !0);
}
}), At(t, function(i) {
return i && n.get(i[r]);
});
} else {
var a = oe(e, null);
return At(t, function(i) {
return i && a != null && i[r] === a;
});
}
}
function z_(r, e) {
return e.hasOwnProperty("subType") ? At(r, function(t) {
return t && t.subType === e.subType;
}) : r;
}
function G_(r) {
var e = X();
return r && A(Pt(r.replaceMerge), function(t) {
process.env.NODE_ENV !== "production" && tt(_t.hasClass(t), '"' + t + '" is not valid component main type in "replaceMerge"'), e.set(t, !0);
}), {
replaceMergeMainTypeMap: e
};
}
ie(Py, Ey);
var YN = [
"getDom",
"getZr",
"getWidth",
"getHeight",
"getDevicePixelRatio",
"dispatchAction",
"isSSR",
"isDisposed",
"on",
"off",
"getDataURL",
"getConnectedDataURL",
// 'getModel',
"getOption",
// 'getViewOfComponentModel',
// 'getViewOfSeriesModel',
"getId",
"updateLabelLayout"
], PD = (
/** @class */
/* @__PURE__ */ function() {
function r(e) {
A(YN, function(t) {
this[t] = Y(e[t], e);
}, this);
}
return r;
}()
), uv = {}, Yo = (
/** @class */
function() {
function r() {
this._coordinateSystems = [];
}
return r.prototype.create = function(e, t) {
var n = [];
A(uv, function(a, i) {
var o = a.create(e, t);
n = n.concat(o || []);
}), this._coordinateSystems = n;
}, r.prototype.update = function(e, t) {
A(this._coordinateSystems, function(n) {
n.update && n.update(e, t);
});
}, r.prototype.getCoordinateSystems = function() {
return this._coordinateSystems.slice();
}, r.register = function(e, t) {
uv[e] = t;
}, r.get = function(e) {
return uv[e];
}, r;
}()
), ZN = /^(min|max)?(.+)$/, XN = (
/** @class */
function() {
function r(e) {
this._timelineOptions = [], this._mediaList = [], this._currentMediaIndices = [], this._api = e;
}
return r.prototype.setOption = function(e, t, n) {
e && (A(Pt(e.series), function(o) {
o && o.data && Ve(o.data) && Ih(o.data);
}), A(Pt(e.dataset), function(o) {
o && o.source && Ve(o.source) && Ih(o.source);
})), e = nt(e);
var a = this._optionBackup, i = qN(e, t, !a);
this._newBaseOption = i.baseOption, a ? (i.timelineOptions.length && (a.timelineOptions = i.timelineOptions), i.mediaList.length && (a.mediaList = i.mediaList), i.mediaDefault && (a.mediaDefault = i.mediaDefault)) : this._optionBackup = i;
}, r.prototype.mountOption = function(e) {
var t = this._optionBackup;
return this._timelineOptions = t.timelineOptions, this._mediaList = t.mediaList, this._mediaDefault = t.mediaDefault, this._currentMediaIndices = [], nt(e ? t.baseOption : this._newBaseOption);
}, r.prototype.getTimelineOption = function(e) {
var t, n = this._timelineOptions;
if (n.length) {
var a = e.getComponent("timeline");
a && (t = nt(
// FIXME:TS as TimelineModel or quivlant interface
n[a.getCurrentIndex()]
));
}
return t;
}, r.prototype.getMediaOption = function(e) {
var t = this._api.getWidth(), n = this._api.getHeight(), a = this._mediaList, i = this._mediaDefault, o = [], s = [];
if (!a.length && !i)
return s;
for (var l = 0, u = a.length; l < u; l++)
KN(a[l].query, t, n) && o.push(l);
return !o.length && i && (o = [-1]), o.length && !QN(o, this._currentMediaIndices) && (s = G(o, function(h) {
return nt(h === -1 ? i.option : a[h].option);
})), this._currentMediaIndices = o, s;
}, r;
}()
);
function qN(r, e, t) {
var n = [], a, i, o = r.baseOption, s = r.timeline, l = r.options, u = r.media, h = !!r.media, f = !!(l || s || o && o.timeline);
o ? (i = o, i.timeline || (i.timeline = s)) : ((f || h) && (r.options = r.media = null), i = r), h && (z(u) ? A(u, function(v) {
process.env.NODE_ENV !== "production" && v && !v.option && J(v.query) && J(v.query.option) && _e("Illegal media option. Must be like { media: [ { query: {}, option: {} } ] }"), v && v.option && (v.query ? n.push(v) : a || (a = v));
}) : process.env.NODE_ENV !== "production" && _e("Illegal media option. Must be an array. Like { media: [ {...}, {...} ] }")), c(i), A(l, function(v) {
return c(v);
}), A(n, function(v) {
return c(v.option);
});
function c(v) {
A(e, function(p) {
p(v, t);
});
}
return {
baseOption: i,
timelineOptions: l || [],
mediaDefault: a,
mediaList: n
};
}
function KN(r, e, t) {
var n = {
width: e,
height: t,
aspectratio: e / t
// lower case for convenience.
}, a = !0;
return A(r, function(i, o) {
var s = o.match(ZN);
if (!(!s || !s[1] || !s[2])) {
var l = s[1], u = s[2].toLowerCase();
jN(n[u], i, l) || (a = !1);
}
}), a;
}
function jN(r, e, t) {
return t === "min" ? r >= e : t === "max" ? r <= e : r === e;
}
function QN(r, e) {
return r.join(",") === e.join(",");
}
var nr = A, dl = J, F_ = ["areaStyle", "lineStyle", "nodeStyle", "linkStyle", "chordStyle", "label", "labelLine"];
function hv(r) {
var e = r && r.itemStyle;
if (e)
for (var t = 0, n = F_.length; t < n; t++) {
var a = F_[t], i = e.normal, o = e.emphasis;
i && i[a] && (process.env.NODE_ENV !== "production" && ee("itemStyle.normal." + a, a), r[a] = r[a] || {}, r[a].normal ? ht(r[a].normal, i[a]) : r[a].normal = i[a], i[a] = null), o && o[a] && (process.env.NODE_ENV !== "production" && ee("itemStyle.emphasis." + a, "emphasis." + a), r[a] = r[a] || {}, r[a].emphasis ? ht(r[a].emphasis, o[a]) : r[a].emphasis = o[a], o[a] = null);
}
}
function Ce(r, e, t) {
if (r && r[e] && (r[e].normal || r[e].emphasis)) {
var n = r[e].normal, a = r[e].emphasis;
n && (process.env.NODE_ENV !== "production" && Nr("'normal' hierarchy in " + e + " has been removed since 4.0. All style properties are configured in " + e + " directly now."), t ? (r[e].normal = r[e].emphasis = null, et(r[e], n)) : r[e] = n), a && (process.env.NODE_ENV !== "production" && Nr(e + ".emphasis has been changed to emphasis." + e + " since 4.0"), r.emphasis = r.emphasis || {}, r.emphasis[e] = a, a.focus && (r.emphasis.focus = a.focus), a.blurScope && (r.emphasis.blurScope = a.blurScope));
}
}
function Vs(r) {
Ce(r, "itemStyle"), Ce(r, "lineStyle"), Ce(r, "areaStyle"), Ce(r, "label"), Ce(r, "labelLine"), Ce(r, "upperLabel"), Ce(r, "edgeLabel");
}
function te(r, e) {
var t = dl(r) && r[e], n = dl(t) && t.textStyle;
if (n) {
process.env.NODE_ENV !== "production" && Nr("textStyle hierarchy in " + e + " has been removed since 4.0. All textStyle properties are configured in " + e + " directly now.");
for (var a = 0, i = U0.length; a < i; a++) {
var o = U0[a];
n.hasOwnProperty(o) && (t[o] = n[o]);
}
}
}
function hr(r) {
r && (Vs(r), te(r, "label"), r.emphasis && te(r.emphasis, "label"));
}
function JN(r) {
if (dl(r)) {
hv(r), Vs(r), te(r, "label"), te(r, "upperLabel"), te(r, "edgeLabel"), r.emphasis && (te(r.emphasis, "label"), te(r.emphasis, "upperLabel"), te(r.emphasis, "edgeLabel"));
var e = r.markPoint;
e && (hv(e), hr(e));
var t = r.markLine;
t && (hv(t), hr(t));
var n = r.markArea;
n && hr(n);
var a = r.data;
if (r.type === "graph") {
a = a || r.nodes;
var i = r.links || r.edges;
if (i && !Ve(i))
for (var o = 0; o < i.length; o++)
hr(i[o]);
A(r.categories, function(u) {
Vs(u);
});
}
if (a && !Ve(a))
for (var o = 0; o < a.length; o++)
hr(a[o]);
if (e = r.markPoint, e && e.data)
for (var s = e.data, o = 0; o < s.length; o++)
hr(s[o]);
if (t = r.markLine, t && t.data)
for (var l = t.data, o = 0; o < l.length; o++)
z(l[o]) ? (hr(l[o][0]), hr(l[o][1])) : hr(l[o]);
r.type === "gauge" ? (te(r, "axisLabel"), te(r, "title"), te(r, "detail")) : r.type === "treemap" ? (Ce(r.breadcrumb, "itemStyle"), A(r.levels, function(u) {
Vs(u);
})) : r.type === "tree" && Vs(r.leaves);
}
}
function cn(r) {
return z(r) ? r : r ? [r] : [];
}
function H_(r) {
return (z(r) ? r[0] : r) || {};
}
function tO(r, e) {
nr(cn(r.series), function(n) {
dl(n) && JN(n);
});
var t = ["xAxis", "yAxis", "radiusAxis", "angleAxis", "singleAxis", "parallelAxis", "radar"];
e && t.push("valueAxis", "categoryAxis", "logAxis", "timeAxis"), nr(t, function(n) {
nr(cn(r[n]), function(a) {
a && (te(a, "axisLabel"), te(a.axisPointer, "label"));
});
}), nr(cn(r.parallel), function(n) {
var a = n && n.parallelAxisDefault;
te(a, "axisLabel"), te(a && a.axisPointer, "label");
}), nr(cn(r.calendar), function(n) {
Ce(n, "itemStyle"), te(n, "dayLabel"), te(n, "monthLabel"), te(n, "yearLabel");
}), nr(cn(r.radar), function(n) {
te(n, "name"), n.name && n.axisName == null && (n.axisName = n.name, delete n.name, process.env.NODE_ENV !== "production" && Nr("name property in radar component has been changed to axisName")), n.nameGap != null && n.axisNameGap == null && (n.axisNameGap = n.nameGap, delete n.nameGap, process.env.NODE_ENV !== "production" && Nr("nameGap property in radar component has been changed to axisNameGap")), process.env.NODE_ENV !== "production" && nr(n.indicator, function(a) {
a.text && ee("text", "name", "radar.indicator");
});
}), nr(cn(r.geo), function(n) {
dl(n) && (hr(n), nr(cn(n.regions), function(a) {
hr(a);
}));
}), nr(cn(r.timeline), function(n) {
hr(n), Ce(n, "label"), Ce(n, "itemStyle"), Ce(n, "controlStyle", !0);
var a = n.data;
z(a) && A(a, function(i) {
J(i) && (Ce(i, "label"), Ce(i, "itemStyle"));
});
}), nr(cn(r.toolbox), function(n) {
Ce(n, "iconStyle"), nr(n.feature, function(a) {
Ce(a, "iconStyle");
});
}), te(H_(r.axisPointer), "label"), te(H_(r.tooltip).axisPointer, "label");
}
function eO(r, e) {
for (var t = e.split(","), n = r, a = 0; a < t.length && (n = n && n[t[a]], n != null); a++)
;
return n;
}
function rO(r, e, t, n) {
for (var a = e.split(","), i = r, o, s = 0; s < a.length - 1; s++)
o = a[s], i[o] == null && (i[o] = {}), i = i[o];
i[a[s]] == null && (i[a[s]] = t);
}
function W_(r) {
r && A(nO, function(e) {
e[0] in r && !(e[1] in r) && (r[e[1]] = r[e[0]]);
});
}
var nO = [["x", "left"], ["y", "top"], ["x2", "right"], ["y2", "bottom"]], aO = ["grid", "geo", "parallel", "legend", "toolbox", "title", "visualMap", "dataZoom", "timeline"], fv = [["borderRadius", "barBorderRadius"], ["borderColor", "barBorderColor"], ["borderWidth", "barBorderWidth"]];
function hs(r) {
var e = r && r.itemStyle;
if (e)
for (var t = 0; t < fv.length; t++) {
var n = fv[t][1], a = fv[t][0];
e[n] != null && (e[a] = e[n], process.env.NODE_ENV !== "production" && ee(n, a));
}
}
function $_(r) {
r && r.alignTo === "edge" && r.margin != null && r.edgeDistance == null && (process.env.NODE_ENV !== "production" && ee("label.margin", "label.edgeDistance", "pie"), r.edgeDistance = r.margin);
}
function U_(r) {
r && r.downplay && !r.blur && (r.blur = r.downplay, process.env.NODE_ENV !== "production" && ee("downplay", "blur", "sunburst"));
}
function iO(r) {
r && r.focusNodeAdjacency != null && (r.emphasis = r.emphasis || {}, r.emphasis.focus == null && (process.env.NODE_ENV !== "production" && ee("focusNodeAdjacency", "emphasis: { focus: 'adjacency'}", "graph/sankey"), r.emphasis.focus = "adjacency"));
}
function kD(r, e) {
if (r)
for (var t = 0; t < r.length; t++)
e(r[t]), r[t] && kD(r[t].children, e);
}
function RD(r, e) {
tO(r, e), r.series = Pt(r.series), A(r.series, function(t) {
if (J(t)) {
var n = t.type;
if (n === "line")
t.clipOverflow != null && (t.clip = t.clipOverflow, process.env.NODE_ENV !== "production" && ee("clipOverflow", "clip", "line"));
else if (n === "pie" || n === "gauge") {
t.clockWise != null && (t.clockwise = t.clockWise, process.env.NODE_ENV !== "production" && ee("clockWise", "clockwise")), $_(t.label);
var a = t.data;
if (a && !Ve(a))
for (var i = 0; i < a.length; i++)
$_(a[i]);
t.hoverOffset != null && (t.emphasis = t.emphasis || {}, (t.emphasis.scaleSize = null) && (process.env.NODE_ENV !== "production" && ee("hoverOffset", "emphasis.scaleSize"), t.emphasis.scaleSize = t.hoverOffset));
} else if (n === "gauge") {
var o = eO(t, "pointer.color");
o != null && rO(t, "itemStyle.color", o);
} else if (n === "bar") {
hs(t), hs(t.backgroundStyle), hs(t.emphasis);
var a = t.data;
if (a && !Ve(a))
for (var i = 0; i < a.length; i++)
typeof a[i] == "object" && (hs(a[i]), hs(a[i] && a[i].emphasis));
} else if (n === "sunburst") {
var s = t.highlightPolicy;
s && (t.emphasis = t.emphasis || {}, t.emphasis.focus || (t.emphasis.focus = s, process.env.NODE_ENV !== "production" && ee("highlightPolicy", "emphasis.focus", "sunburst"))), U_(t), kD(t.data, U_);
} else n === "graph" || n === "sankey" ? iO(t) : n === "map" && (t.mapType && !t.map && (process.env.NODE_ENV !== "production" && ee("mapType", "map", "map"), t.map = t.mapType), t.mapLocation && (process.env.NODE_ENV !== "production" && Nr("`mapLocation` is not used anymore."), et(t, t.mapLocation)));
t.hoverAnimation != null && (t.emphasis = t.emphasis || {}, t.emphasis && t.emphasis.scale == null && (process.env.NODE_ENV !== "production" && ee("hoverAnimation", "emphasis.scale"), t.emphasis.scale = t.hoverAnimation)), W_(t);
}
}), r.dataRange && (r.visualMap = r.dataRange), A(aO, function(t) {
var n = r[t];
n && (z(n) || (n = [n]), A(n, function(a) {
W_(a);
}));
});
}
function oO(r) {
var e = X();
r.eachSeries(function(t) {
var n = t.get("stack");
if (n) {
var a = e.get(n) || e.set(n, []), i = t.getData(), o = {
// Used for calculate axis extent automatically.
// TODO: Type getCalculationInfo return more specific type?
stackResultDimension: i.getCalculationInfo("stackResultDimension"),
stackedOverDimension: i.getCalculationInfo("stackedOverDimension"),
stackedDimension: i.getCalculationInfo("stackedDimension"),
stackedByDimension: i.getCalculationInfo("stackedByDimension"),
isStackedByIndex: i.getCalculationInfo("isStackedByIndex"),
data: i,
seriesModel: t
};
if (!o.stackedDimension || !(o.isStackedByIndex || o.stackedByDimension))
return;
a.length && i.setCalculationInfo("stackedOnSeries", a[a.length - 1].seriesModel), a.push(o);
}
}), e.each(sO);
}
function sO(r) {
A(r, function(e, t) {
var n = [], a = [NaN, NaN], i = [e.stackResultDimension, e.stackedOverDimension], o = e.data, s = e.isStackedByIndex, l = e.seriesModel.get("stackStrategy") || "samesign";
o.modify(i, function(u, h, f) {
var c = o.get(e.stackedDimension, f);
if (isNaN(c))
return a;
var v, p;
s ? p = o.getRawIndex(f) : v = o.get(e.stackedByDimension, f);
for (var d = NaN, g = t - 1; g >= 0; g--) {
var y = r[g];
if (s || (p = y.data.rawIndexOf(y.stackedByDimension, v)), p >= 0) {
var m = y.data.getByRawIndex(y.stackResultDimension, p);
if (l === "all" || l === "positive" && m > 0 || l === "negative" && m < 0 || l === "samesign" && c >= 0 && m > 0 || l === "samesign" && c <= 0 && m < 0) {
c = QP(c, m), d = m;
break;
}
}
}
return n[0] = c, n[1] = d, n;
});
});
}
var rc = (
/** @class */
/* @__PURE__ */ function() {
function r(e) {
this.data = e.data || (e.sourceFormat === ln ? {} : []), this.sourceFormat = e.sourceFormat || DD, this.seriesLayoutBy = e.seriesLayoutBy || en, this.startIndex = e.startIndex || 0, this.dimensionsDetectedCount = e.dimensionsDetectedCount, this.metaRawOption = e.metaRawOption;
var t = this.dimensionsDefine = e.dimensionsDefine;
if (t)
for (var n = 0; n < t.length; n++) {
var a = t[n];
a.type == null && ID(this, n) === ye.Must && (a.type = "ordinal");
}
}
return r;
}()
);
function ky(r) {
return r instanceof rc;
}
function Vd(r, e, t) {
t = t || ND(r);
var n = e.seriesLayoutBy, a = uO(r, t, n, e.sourceHeader, e.dimensions), i = new rc({
data: r,
sourceFormat: t,
seriesLayoutBy: n,
dimensionsDefine: a.dimensionsDefine,
startIndex: a.startIndex,
dimensionsDetectedCount: a.dimensionsDetectedCount,
metaRawOption: nt(e)
});
return i;
}
function Ry(r) {
return new rc({
data: r,
sourceFormat: Ve(r) ? wn : br
});
}
function lO(r) {
return new rc({
data: r.data,
sourceFormat: r.sourceFormat,
seriesLayoutBy: r.seriesLayoutBy,
dimensionsDefine: nt(r.dimensionsDefine),
startIndex: r.startIndex,
dimensionsDetectedCount: r.dimensionsDetectedCount
});
}
function ND(r) {
var e = DD;
if (Ve(r))
e = wn;
else if (z(r)) {
r.length === 0 && (e = Ae);
for (var t = 0, n = r.length; t < n; t++) {
var a = r[t];
if (a != null) {
if (z(a) || Ve(a)) {
e = Ae;
break;
} else if (J(a)) {
e = wr;
break;
}
}
}
} else if (J(r)) {
for (var i in r)
if (Z(r, i) && De(r[i])) {
e = ln;
break;
}
}
return e;
}
function uO(r, e, t, n, a) {
var i, o;
if (!r)
return {
dimensionsDefine: Y_(a),
startIndex: o,
dimensionsDetectedCount: i
};
if (e === Ae) {
var s = r;
n === "auto" || n == null ? Z_(function(u) {
u != null && u !== "-" && (U(u) ? o == null && (o = 1) : o = 0);
}, t, s, 10) : o = Tt(n) ? n : n ? 1 : 0, !a && o === 1 && (a = [], Z_(function(u, h) {
a[h] = u != null ? u + "" : "";
}, t, s, 1 / 0)), i = a ? a.length : t === Uo ? s.length : s[0] ? s[0].length : null;
} else if (e === wr)
a || (a = hO(r));
else if (e === ln)
a || (a = [], A(r, function(u, h) {
a.push(h);
}));
else if (e === br) {
var l = Bo(r[0]);
i = z(l) && l.length || 1;
} else e === wn && process.env.NODE_ENV !== "production" && tt(!!a, "dimensions must be given if data is TypedArray.");
return {
startIndex: o,
dimensionsDefine: Y_(a),
dimensionsDetectedCount: i
};
}
function hO(r) {
for (var e = 0, t; e < r.length && !(t = r[e++]); )
;
if (t)
return St(t);
}
function Y_(r) {
if (r) {
var e = X();
return G(r, function(t, n) {
t = J(t) ? t : {
name: t
};
var a = {
name: t.name,
displayName: t.displayName,
type: t.type
};
if (a.name == null)
return a;
a.name += "", a.displayName == null && (a.displayName = a.name);
var i = e.get(a.name);
return i ? a.name += "-" + i.count++ : e.set(a.name, {
count: 1
}), a;
});
}
}
function Z_(r, e, t, n) {
if (e === Uo)
for (var a = 0; a < t.length && a < n; a++)
r(t[a] ? t[a][0] : null, a);
else
for (var i = t[0] || [], a = 0; a < i.length && a < n; a++)
r(i[a], a);
}
function OD(r) {
var e = r.sourceFormat;
return e === wr || e === ln;
}
var Va, Ba, za, X_, q_, VD = (
/** @class */
function() {
function r(e, t) {
var n = ky(e) ? e : Ry(e);
this._source = n;
var a = this._data = n.data;
if (n.sourceFormat === wn) {
if (process.env.NODE_ENV !== "production" && t == null)
throw new Error("Typed array data must specify dimension size");
this._offset = 0, this._dimSize = t, this._data = a;
}
q_(this, a, n);
}
return r.prototype.getSource = function() {
return this._source;
}, r.prototype.count = function() {
return 0;
}, r.prototype.getItem = function(e, t) {
}, r.prototype.appendData = function(e) {
}, r.prototype.clean = function() {
}, r.protoInitialize = function() {
var e = r.prototype;
e.pure = !1, e.persistent = !0;
}(), r.internalField = function() {
var e;
q_ = function(o, s, l) {
var u = l.sourceFormat, h = l.seriesLayoutBy, f = l.startIndex, c = l.dimensionsDefine, v = X_[Ny(u, h)];
if (process.env.NODE_ENV !== "production" && tt(v, "Invalide sourceFormat: " + u), B(o, v), u === wn)
o.getItem = t, o.count = a, o.fillStorage = n;
else {
var p = BD(u, h);
o.getItem = Y(p, null, s, f, c);
var d = zD(u, h);
o.count = Y(d, null, s, f, c);
}
};
var t = function(o, s) {
o = o - this._offset, s = s || [];
for (var l = this._data, u = this._dimSize, h = u * o, f = 0; f < u; f++)
s[f] = l[h + f];
return s;
}, n = function(o, s, l, u) {
for (var h = this._data, f = this._dimSize, c = 0; c < f; c++) {
for (var v = u[c], p = v[0] == null ? 1 / 0 : v[0], d = v[1] == null ? -1 / 0 : v[1], g = s - o, y = l[c], m = 0; m < g; m++) {
var _ = h[m * f + c];
y[o + m] = _, _ < p && (p = _), _ > d && (d = _);
}
v[0] = p, v[1] = d;
}
}, a = function() {
return this._data ? this._data.length / this._dimSize : 0;
};
X_ = (e = {}, e[Ae + "_" + en] = {
pure: !0,
appendData: i
}, e[Ae + "_" + Uo] = {
pure: !0,
appendData: function() {
throw new Error('Do not support appendData when set seriesLayoutBy: "row".');
}
}, e[wr] = {
pure: !0,
appendData: i
}, e[ln] = {
pure: !0,
appendData: function(o) {
var s = this._data;
A(o, function(l, u) {
for (var h = s[u] || (s[u] = []), f = 0; f < (l || []).length; f++)
h.push(l[f]);
});
}
}, e[br] = {
appendData: i
}, e[wn] = {
persistent: !1,
pure: !0,
appendData: function(o) {
process.env.NODE_ENV !== "production" && tt(Ve(o), "Added data must be TypedArray if data in initialization is TypedArray"), this._data = o;
},
// Clean self if data is already used.
clean: function() {
this._offset += this.count(), this._data = null;
}
}, e);
function i(o) {
for (var s = 0; s < o.length; s++)
this._data.push(o[s]);
}
}(), r;
}()
), K_ = function(r, e, t, n) {
return r[n];
}, fO = (Va = {}, Va[Ae + "_" + en] = function(r, e, t, n) {
return r[n + e];
}, Va[Ae + "_" + Uo] = function(r, e, t, n, a) {
n += e;
for (var i = a || [], o = r, s = 0; s < o.length; s++) {
var l = o[s];
i[s] = l ? l[n] : null;
}
return i;
}, Va[wr] = K_, Va[ln] = function(r, e, t, n, a) {
for (var i = a || [], o = 0; o < t.length; o++) {
var s = t[o].name;
if (process.env.NODE_ENV !== "production" && s == null)
throw new Error();
var l = r[s];
i[o] = l ? l[n] : null;
}
return i;
}, Va[br] = K_, Va);
function BD(r, e) {
var t = fO[Ny(r, e)];
return process.env.NODE_ENV !== "production" && tt(t, 'Do not support get item on "' + r + '", "' + e + '".'), t;
}
var j_ = function(r, e, t) {
return r.length;
}, cO = (Ba = {}, Ba[Ae + "_" + en] = function(r, e, t) {
return Math.max(0, r.length - e);
}, Ba[Ae + "_" + Uo] = function(r, e, t) {
var n = r[0];
return n ? Math.max(0, n.length - e) : 0;
}, Ba[wr] = j_, Ba[ln] = function(r, e, t) {
var n = t[0].name;
if (process.env.NODE_ENV !== "production" && n == null)
throw new Error();
var a = r[n];
return a ? a.length : 0;
}, Ba[br] = j_, Ba);
function zD(r, e) {
var t = cO[Ny(r, e)];
return process.env.NODE_ENV !== "production" && tt(t, 'Do not support count on "' + r + '", "' + e + '".'), t;
}
var cv = function(r, e, t) {
return r[e];
}, vO = (za = {}, za[Ae] = cv, za[wr] = function(r, e, t) {
return r[t];
}, za[ln] = cv, za[br] = function(r, e, t) {
var n = Bo(r);
return n instanceof Array ? n[e] : n;
}, za[wn] = cv, za);
function GD(r) {
var e = vO[r];
return process.env.NODE_ENV !== "production" && tt(e, 'Do not support get value on "' + r + '".'), e;
}
function Ny(r, e) {
return r === Ae ? r + "_" + e : r;
}
function Ao(r, e, t) {
if (r) {
var n = r.getRawDataItem(e);
if (n != null) {
var a = r.getStore(), i = a.getSource().sourceFormat;
if (t != null) {
var o = r.getDimensionIndex(t), s = a.getDimensionProperty(o);
return GD(i)(n, o, s);
} else {
var l = n;
return i === br && (l = Bo(n)), l;
}
}
}
}
var pO = /\{@(.+?)\}/g, nc = (
/** @class */
function() {
function r() {
}
return r.prototype.getDataParams = function(e, t) {
var n = this.getData(t), a = this.getRawValue(e, t), i = n.getRawIndex(e), o = n.getName(e), s = n.getRawDataItem(e), l = n.getItemVisual(e, "style"), u = l && l[n.getItemVisual(e, "drawType") || "fill"], h = l && l.stroke, f = this.mainType, c = f === "series", v = n.userOutput && n.userOutput.get();
return {
componentType: f,
componentSubType: this.subType,
componentIndex: this.componentIndex,
seriesType: c ? this.subType : null,
seriesIndex: this.seriesIndex,
seriesId: c ? this.id : null,
seriesName: c ? this.name : null,
name: o,
dataIndex: i,
data: s,
dataType: t,
value: a,
color: u,
borderColor: h,
dimensionNames: v ? v.fullDimensions : null,
encode: v ? v.encode : null,
// Param name list for mapping `a`, `b`, `c`, `d`, `e`
$vars: ["seriesName", "name", "value"]
};
}, r.prototype.getFormattedLabel = function(e, t, n, a, i, o) {
t = t || "normal";
var s = this.getData(n), l = this.getDataParams(e, n);
if (o && (l.value = o.interpolatedValue), a != null && z(l.value) && (l.value = l.value[a]), !i) {
var u = s.getItemModel(e);
i = u.get(t === "normal" ? ["label", "formatter"] : [t, "label", "formatter"]);
}
if (K(i))
return l.status = t, l.dimensionIndex = a, i(l);
if (U(i)) {
var h = bD(i, l);
return h.replace(pO, function(f, c) {
var v = c.length, p = c;
p.charAt(0) === "[" && p.charAt(v - 1) === "]" && (p = +p.slice(1, v - 1), process.env.NODE_ENV !== "production" && isNaN(p) && _e("Invalide label formatter: @" + c + ", only support @[0], @[1], @[2], ..."));
var d = Ao(s, e, p);
if (o && z(o.interpolatedValue)) {
var g = s.getDimensionIndex(p);
g >= 0 && (d = o.interpolatedValue[g]);
}
return d != null ? d + "" : "";
});
}
}, r.prototype.getRawValue = function(e, t) {
return Ao(this.getData(t), e);
}, r.prototype.formatTooltip = function(e, t, n) {
}, r;
}()
);
function Q_(r) {
var e, t;
return J(r) ? r.type ? t = r : process.env.NODE_ENV !== "production" && console.warn("The return type of `formatTooltip` is not supported: " + Be(r)) : e = r, {
text: e,
// markers: markers || markersExisting,
frag: t
};
}
function tl(r) {
return new dO(r);
}
var dO = (
/** @class */
function() {
function r(e) {
e = e || {}, this._reset = e.reset, this._plan = e.plan, this._count = e.count, this._onDirty = e.onDirty, this._dirty = !0;
}
return r.prototype.perform = function(e) {
var t = this._upstream, n = e && e.skip;
if (this._dirty && t) {
var a = this.context;
a.data = a.outputData = t.context.outputData;
}
this.__pipeline && (this.__pipeline.currentTask = this);
var i;
this._plan && !n && (i = this._plan(this.context));
var o = h(this._modBy), s = this._modDataCount || 0, l = h(e && e.modBy), u = e && e.modDataCount || 0;
(o !== l || s !== u) && (i = "reset");
function h(m) {
return !(m >= 1) && (m = 1), m;
}
var f;
(this._dirty || i === "reset") && (this._dirty = !1, f = this._doReset(n)), this._modBy = l, this._modDataCount = u;
var c = e && e.step;
if (t ? (process.env.NODE_ENV !== "production" && tt(t._outputDueEnd != null), this._dueEnd = t._outputDueEnd) : (process.env.NODE_ENV !== "production" && tt(!this._progress || this._count), this._dueEnd = this._count ? this._count(this.context) : 1 / 0), this._progress) {
var v = this._dueIndex, p = Math.min(c != null ? this._dueIndex + c : 1 / 0, this._dueEnd);
if (!n && (f || v < p)) {
var d = this._progress;
if (z(d))
for (var g = 0; g < d.length; g++)
this._doProgress(d[g], v, p, l, u);
else
this._doProgress(d, v, p, l, u);
}
this._dueIndex = p;
var y = this._settedOutputEnd != null ? this._settedOutputEnd : p;
process.env.NODE_ENV !== "production" && tt(y >= this._outputDueEnd), this._outputDueEnd = y;
} else
this._dueIndex = this._outputDueEnd = this._settedOutputEnd != null ? this._settedOutputEnd : this._dueEnd;
return this.unfinished();
}, r.prototype.dirty = function() {
this._dirty = !0, this._onDirty && this._onDirty(this.context);
}, r.prototype._doProgress = function(e, t, n, a, i) {
J_.reset(t, n, a, i), this._callingProgress = e, this._callingProgress({
start: t,
end: n,
count: n - t,
next: J_.next
}, this.context);
}, r.prototype._doReset = function(e) {
this._dueIndex = this._outputDueEnd = this._dueEnd = 0, this._settedOutputEnd = null;
var t, n;
!e && this._reset && (t = this._reset(this.context), t && t.progress && (n = t.forceFirstProgress, t = t.progress), z(t) && !t.length && (t = null)), this._progress = t, this._modBy = this._modDataCount = null;
var a = this._downstream;
return a && a.dirty(), n;
}, r.prototype.unfinished = function() {
return this._progress && this._dueIndex < this._dueEnd;
}, r.prototype.pipe = function(e) {
process.env.NODE_ENV !== "production" && tt(e && !e._disposed && e !== this), (this._downstream !== e || this._dirty) && (this._downstream = e, e._upstream = this, e.dirty());
}, r.prototype.dispose = function() {
this._disposed || (this._upstream && (this._upstream._downstream = null), this._downstream && (this._downstream._upstream = null), this._dirty = !1, this._disposed = !0);
}, r.prototype.getUpstream = function() {
return this._upstream;
}, r.prototype.getDownstream = function() {
return this._downstream;
}, r.prototype.setOutputEnd = function(e) {
this._outputDueEnd = this._settedOutputEnd = e;
}, r;
}()
), J_ = /* @__PURE__ */ function() {
var r, e, t, n, a, i = {
reset: function(l, u, h, f) {
e = l, r = u, t = h, n = f, a = Math.ceil(n / t), i.next = t > 1 && n > 0 ? s : o;
}
};
return i;
function o() {
return e < r ? e++ : null;
}
function s() {
var l = e % a * t + Math.ceil(e / a), u = e >= r ? null : l < n ? l : e;
return e++, u;
}
}();
function sa(r, e) {
var t = e && e.type;
return t === "ordinal" ? r : (t === "time" && !Tt(r) && r != null && r !== "-" && (r = +on(r)), r == null || r === "" ? NaN : Number(r));
}
var gO = X({
number: function(r) {
return parseFloat(r);
},
time: function(r) {
return +on(r);
},
trim: function(r) {
return U(r) ? Ir(r) : r;
}
});
function FD(r) {
return gO.get(r);
}
var HD = {
lt: function(r, e) {
return r < e;
},
lte: function(r, e) {
return r <= e;
},
gt: function(r, e) {
return r > e;
},
gte: function(r, e) {
return r >= e;
}
}, yO = (
/** @class */
function() {
function r(e, t) {
if (!Tt(t)) {
var n = "";
process.env.NODE_ENV !== "production" && (n = 'rvalue of "<", ">", "<=", ">=" can only be number in filter.'), Dt(n);
}
this._opFn = HD[e], this._rvalFloat = An(t);
}
return r.prototype.evaluate = function(e) {
return Tt(e) ? this._opFn(e, this._rvalFloat) : this._opFn(An(e), this._rvalFloat);
}, r;
}()
), WD = (
/** @class */
function() {
function r(e, t) {
var n = e === "desc";
this._resultLT = n ? 1 : -1, t == null && (t = n ? "min" : "max"), this._incomparable = t === "min" ? -1 / 0 : 1 / 0;
}
return r.prototype.evaluate = function(e, t) {
var n = Tt(e) ? e : An(e), a = Tt(t) ? t : An(t), i = isNaN(n), o = isNaN(a);
if (i && (n = this._incomparable), o && (a = this._incomparable), i && o) {
var s = U(e), l = U(t);
s && (n = l ? e : 0), l && (a = s ? t : 0);
}
return n < a ? this._resultLT : n > a ? -this._resultLT : 0;
}, r;
}()
), mO = (
/** @class */
function() {
function r(e, t) {
this._rval = t, this._isEQ = e, this._rvalTypeof = typeof t, this._rvalFloat = An(t);
}
return r.prototype.evaluate = function(e) {
var t = e === this._rval;
if (!t) {
var n = typeof e;
n !== this._rvalTypeof && (n === "number" || this._rvalTypeof === "number") && (t = An(e) === this._rvalFloat);
}
return this._isEQ ? t : !t;
}, r;
}()
);
function _O(r, e) {
return r === "eq" || r === "ne" ? new mO(r === "eq", e) : Z(HD, r) ? new yO(r, e) : null;
}
var SO = (
/** @class */
function() {
function r() {
}
return r.prototype.getRawData = function() {
throw new Error("not supported");
}, r.prototype.getRawDataItem = function(e) {
throw new Error("not supported");
}, r.prototype.cloneRawData = function() {
}, r.prototype.getDimensionInfo = function(e) {
}, r.prototype.cloneAllDimensionInfo = function() {
}, r.prototype.count = function() {
}, r.prototype.retrieveValue = function(e, t) {
}, r.prototype.retrieveValueFromItem = function(e, t) {
}, r.prototype.convertValue = function(e, t) {
return sa(e, t);
}, r;
}()
);
function xO(r, e) {
var t = new SO(), n = r.data, a = t.sourceFormat = r.sourceFormat, i = r.startIndex, o = "";
r.seriesLayoutBy !== en && (process.env.NODE_ENV !== "production" && (o = '`seriesLayoutBy` of upstream dataset can only be "column" in data transform.'), Dt(o));
var s = [], l = {}, u = r.dimensionsDefine;
if (u)
A(u, function(d, g) {
var y = d.name, m = {
index: g,
name: y,
displayName: d.displayName
};
if (s.push(m), y != null) {
var _ = "";
Z(l, y) && (process.env.NODE_ENV !== "production" && (_ = 'dimension name "' + y + '" duplicated.'), Dt(_)), l[y] = m;
}
});
else
for (var h = 0; h < r.dimensionsDetectedCount; h++)
s.push({
index: h
});
var f = BD(a, en);
e.__isBuiltIn && (t.getRawDataItem = function(d) {
return f(n, i, s, d);
}, t.getRawData = Y(bO, null, r)), t.cloneRawData = Y(wO, null, r);
var c = zD(a, en);
t.count = Y(c, null, n, i, s);
var v = GD(a);
t.retrieveValue = function(d, g) {
var y = f(n, i, s, d);
return p(y, g);
};
var p = t.retrieveValueFromItem = function(d, g) {
if (d != null) {
var y = s[g];
if (y)
return v(d, g, y.name);
}
};
return t.getDimensionInfo = Y(TO, null, s, l), t.cloneAllDimensionInfo = Y(CO, null, s), t;
}
function bO(r) {
var e = r.sourceFormat;
if (!Oy(e)) {
var t = "";
process.env.NODE_ENV !== "production" && (t = "`getRawData` is not supported in source format " + e), Dt(t);
}
return r.data;
}
function wO(r) {
var e = r.sourceFormat, t = r.data;
if (!Oy(e)) {
var n = "";
process.env.NODE_ENV !== "production" && (n = "`cloneRawData` is not supported in source format " + e), Dt(n);
}
if (e === Ae) {
for (var a = [], i = 0, o = t.length; i < o; i++)
a.push(t[i].slice());
return a;
} else if (e === wr) {
for (var a = [], i = 0, o = t.length; i < o; i++)
a.push(B({}, t[i]));
return a;
}
}
function TO(r, e, t) {
if (t != null) {
if (Tt(t) || !isNaN(t) && !Z(e, t))
return r[t];
if (Z(e, t))
return e[t];
}
}
function CO(r) {
return nt(r);
}
var $D = X();
function DO(r) {
r = nt(r);
var e = r.type, t = "";
e || (process.env.NODE_ENV !== "production" && (t = "Must have a `type` when `registerTransform`."), Dt(t));
var n = e.split(":");
n.length !== 2 && (process.env.NODE_ENV !== "production" && (t = 'Name must include namespace like "ns:regression".'), Dt(t));
var a = !1;
n[0] === "echarts" && (e = n[1], a = !0), r.__isBuiltIn = a, $D.set(e, r);
}
function AO(r, e, t) {
var n = Pt(r), a = n.length, i = "";
a || (process.env.NODE_ENV !== "production" && (i = "If `transform` declared, it should at least contain one transform."), Dt(i));
for (var o = 0, s = a; o < s; o++) {
var l = n[o];
e = MO(l, e, t, a === 1 ? null : o), o !== s - 1 && (e.length = Math.max(e.length, 1));
}
return e;
}
function MO(r, e, t, n) {
var a = "";
e.length || (process.env.NODE_ENV !== "production" && (a = "Must have at least one upstream dataset."), Dt(a)), J(r) || (process.env.NODE_ENV !== "production" && (a = "transform declaration must be an object rather than " + typeof r + "."), Dt(a));
var i = r.type, o = $D.get(i);
o || (process.env.NODE_ENV !== "production" && (a = 'Can not find transform on type "' + i + '".'), Dt(a));
var s = G(e, function(h) {
return xO(h, o);
}), l = Pt(o.transform({
upstream: s[0],
upstreamList: s,
config: nt(r.config)
}));
if (process.env.NODE_ENV !== "production" && r.print) {
var u = G(l, function(h) {
var f = n != null ? " === pipe index: " + n : "";
return ["=== dataset index: " + t.datasetIndex + f + " ===", "- transform result data:", Be(h.data), "- transform result dimensions:", Be(h.dimensions)].join(`
`);
}).join(`
`);
nk(u);
}
return G(l, function(h, f) {
var c = "";
J(h) || (process.env.NODE_ENV !== "production" && (c = "A transform should not return some empty results."), Dt(c)), h.data || (process.env.NODE_ENV !== "production" && (c = "Transform result data should be not be null or undefined"), Dt(c));
var v = ND(h.data);
Oy(v) || (process.env.NODE_ENV !== "production" && (c = "Transform result data should be array rows or object rows."), Dt(c));
var p, d = e[0];
if (d && f === 0 && !h.dimensions) {
var g = d.startIndex;
g && (h.data = d.data.slice(0, g).concat(h.data)), p = {
seriesLayoutBy: en,
sourceHeader: g,
dimensions: d.metaRawOption.dimensions
};
} else
p = {
seriesLayoutBy: en,
sourceHeader: 0,
dimensions: h.dimensions
};
return Vd(h.data, p, null);
});
}
function Oy(r) {
return r === Ae || r === wr;
}
var ac = "undefined", IO = typeof Uint32Array === ac ? Array : Uint32Array, LO = typeof Uint16Array === ac ? Array : Uint16Array, UD = typeof Int32Array === ac ? Array : Int32Array, t1 = typeof Float64Array === ac ? Array : Float64Array, YD = {
float: t1,
int: UD,
// Ordinal data type can be string or int
ordinal: Array,
number: Array,
time: t1
}, vv;
function Yi(r) {
return r > 65535 ? IO : LO;
}
function Zi() {
return [1 / 0, -1 / 0];
}
function EO(r) {
var e = r.constructor;
return e === Array ? r.slice() : new e(r);
}
function e1(r, e, t, n, a) {
var i = YD[t || "float"];
if (a) {
var o = r[e], s = o && o.length;
if (s !== n) {
for (var l = new i(n), u = 0; u < s; u++)
l[u] = o[u];
r[e] = l;
}
} else
r[e] = new i(n);
}
var Bd = (
/** @class */
function() {
function r() {
this._chunks = [], this._rawExtent = [], this._extent = [], this._count = 0, this._rawCount = 0, this._calcDimNameToIdx = X();
}
return r.prototype.initData = function(e, t, n) {
process.env.NODE_ENV !== "production" && tt(K(e.getItem) && K(e.count), "Invalid data provider."), this._provider = e, this._chunks = [], this._indices = null, this.getRawIndex = this._getRawIdxIdentity;
var a = e.getSource(), i = this.defaultDimValueGetter = vv[a.sourceFormat];
this._dimValueGetter = n || i, this._rawExtent = [];
var o = OD(a);
this._dimensions = G(t, function(s) {
return process.env.NODE_ENV !== "production" && o && tt(s.property != null), {
// Only pick these two props. Not leak other properties like orderMeta.
type: s.type,
property: s.property
};
}), this._initDataFromProvider(0, e.count());
}, r.prototype.getProvider = function() {
return this._provider;
}, r.prototype.getSource = function() {
return this._provider.getSource();
}, r.prototype.ensureCalculationDimension = function(e, t) {
var n = this._calcDimNameToIdx, a = this._dimensions, i = n.get(e);
if (i != null) {
if (a[i].type === t)
return i;
} else
i = a.length;
return a[i] = {
type: t
}, n.set(e, i), this._chunks[i] = new YD[t || "float"](this._rawCount), this._rawExtent[i] = Zi(), i;
}, r.prototype.collectOrdinalMeta = function(e, t) {
var n = this._chunks[e], a = this._dimensions[e], i = this._rawExtent, o = a.ordinalOffset || 0, s = n.length;
o === 0 && (i[e] = Zi());
for (var l = i[e], u = o; u < s; u++) {
var h = n[u] = t.parseAndCollect(n[u]);
isNaN(h) || (l[0] = Math.min(h, l[0]), l[1] = Math.max(h, l[1]));
}
a.ordinalMeta = t, a.ordinalOffset = s, a.type = "ordinal";
}, r.prototype.getOrdinalMeta = function(e) {
var t = this._dimensions[e], n = t.ordinalMeta;
return n;
}, r.prototype.getDimensionProperty = function(e) {
var t = this._dimensions[e];
return t && t.property;
}, r.prototype.appendData = function(e) {
process.env.NODE_ENV !== "production" && tt(!this._indices, "appendData can only be called on raw data.");
var t = this._provider, n = this.count();
t.appendData(e);
var a = t.count();
return t.persistent || (a += n), n < a && this._initDataFromProvider(n, a, !0), [n, a];
}, r.prototype.appendValues = function(e, t) {
for (var n = this._chunks, a = this._dimensions, i = a.length, o = this._rawExtent, s = this.count(), l = s + Math.max(e.length, t || 0), u = 0; u < i; u++) {
var h = a[u];
e1(n, u, h.type, l, !0);
}
for (var f = [], c = s; c < l; c++)
for (var v = c - s, p = 0; p < i; p++) {
var h = a[p], d = vv.arrayRows.call(this, e[v] || f, h.property, v, p);
n[p][c] = d;
var g = o[p];
d < g[0] && (g[0] = d), d > g[1] && (g[1] = d);
}
return this._rawCount = this._count = l, {
start: s,
end: l
};
}, r.prototype._initDataFromProvider = function(e, t, n) {
for (var a = this._provider, i = this._chunks, o = this._dimensions, s = o.length, l = this._rawExtent, u = G(o, function(m) {
return m.property;
}), h = 0; h < s; h++) {
var f = o[h];
l[h] || (l[h] = Zi()), e1(i, h, f.type, t, n);
}
if (a.fillStorage)
a.fillStorage(e, t, i, l);
else
for (var c = [], v = e; v < t; v++) {
c = a.getItem(v, c);
for (var p = 0; p < s; p++) {
var d = i[p], g = this._dimValueGetter(c, u[p], v, p);
d[v] = g;
var y = l[p];
g < y[0] && (y[0] = g), g > y[1] && (y[1] = g);
}
}
!a.persistent && a.clean && a.clean(), this._rawCount = this._count = t, this._extent = [];
}, r.prototype.count = function() {
return this._count;
}, r.prototype.get = function(e, t) {
if (!(t >= 0 && t < this._count))
return NaN;
var n = this._chunks[e];
return n ? n[this.getRawIndex(t)] : NaN;
}, r.prototype.getValues = function(e, t) {
var n = [], a = [];
if (t == null) {
t = e, e = [];
for (var i = 0; i < this._dimensions.length; i++)
a.push(i);
} else
a = e;
for (var i = 0, o = a.length; i < o; i++)
n.push(this.get(a[i], t));
return n;
}, r.prototype.getByRawIndex = function(e, t) {
if (!(t >= 0 && t < this._rawCount))
return NaN;
var n = this._chunks[e];
return n ? n[t] : NaN;
}, r.prototype.getSum = function(e) {
var t = this._chunks[e], n = 0;
if (t)
for (var a = 0, i = this.count(); a < i; a++) {
var o = this.get(e, a);
isNaN(o) || (n += o);
}
return n;
}, r.prototype.getMedian = function(e) {
var t = [];
this.each([e], function(i) {
isNaN(i) || t.push(i);
});
var n = t.sort(function(i, o) {
return i - o;
}), a = this.count();
return a === 0 ? 0 : a % 2 === 1 ? n[(a - 1) / 2] : (n[a / 2] + n[a / 2 - 1]) / 2;
}, r.prototype.indexOfRawIndex = function(e) {
if (e >= this._rawCount || e < 0)
return -1;
if (!this._indices)
return e;
var t = this._indices, n = t[e];
if (n != null && n < this._count && n === e)
return e;
for (var a = 0, i = this._count - 1; a <= i; ) {
var o = (a + i) / 2 | 0;
if (t[o] < e)
a = o + 1;
else if (t[o] > e)
i = o - 1;
else
return o;
}
return -1;
}, r.prototype.indicesOfNearest = function(e, t, n) {
var a = this._chunks, i = a[e], o = [];
if (!i)
return o;
n == null && (n = 1 / 0);
for (var s = 1 / 0, l = -1, u = 0, h = 0, f = this.count(); h < f; h++) {
var c = this.getRawIndex(h), v = t - i[c], p = Math.abs(v);
p <= n && ((p < s || p === s && v >= 0 && l < 0) && (s = p, l = v, u = 0), v === l && (o[u++] = h));
}
return o.length = u, o;
}, r.prototype.getIndices = function() {
var e, t = this._indices;
if (t) {
var n = t.constructor, a = this._count;
if (n === Array) {
e = new n(a);
for (var i = 0; i < a; i++)
e[i] = t[i];
} else
e = new n(t.buffer, 0, a);
} else {
var n = Yi(this._rawCount);
e = new n(this.count());
for (var i = 0; i < e.length; i++)
e[i] = i;
}
return e;
}, r.prototype.filter = function(e, t) {
if (!this._count)
return this;
for (var n = this.clone(), a = n.count(), i = Yi(n._rawCount), o = new i(a), s = [], l = e.length, u = 0, h = e[0], f = n._chunks, c = 0; c < a; c++) {
var v = void 0, p = n.getRawIndex(c);
if (l === 0)
v = t(c);
else if (l === 1) {
var d = f[h][p];
v = t(d, c);
} else {
for (var g = 0; g < l; g++)
s[g] = f[e[g]][p];
s[g] = c, v = t.apply(null, s);
}
v && (o[u++] = p);
}
return u < a && (n._indices = o), n._count = u, n._extent = [], n._updateGetRawIdx(), n;
}, r.prototype.selectRange = function(e) {
var t = this.clone(), n = t._count;
if (!n)
return this;
var a = St(e), i = a.length;
if (!i)
return this;
var o = t.count(), s = Yi(t._rawCount), l = new s(o), u = 0, h = a[0], f = e[h][0], c = e[h][1], v = t._chunks, p = !1;
if (!t._indices) {
var d = 0;
if (i === 1) {
for (var g = v[a[0]], y = 0; y < n; y++) {
var m = g[y];
(m >= f && m <= c || isNaN(m)) && (l[u++] = d), d++;
}
p = !0;
} else if (i === 2) {
for (var g = v[a[0]], _ = v[a[1]], S = e[a[1]][0], x = e[a[1]][1], y = 0; y < n; y++) {
var m = g[y], b = _[y];
(m >= f && m <= c || isNaN(m)) && (b >= S && b <= x || isNaN(b)) && (l[u++] = d), d++;
}
p = !0;
}
}
if (!p)
if (i === 1)
for (var y = 0; y < o; y++) {
var w = t.getRawIndex(y), m = v[a[0]][w];
(m >= f && m <= c || isNaN(m)) && (l[u++] = w);
}
else
for (var y = 0; y < o; y++) {
for (var T = !0, w = t.getRawIndex(y), C = 0; C < i; C++) {
var D = a[C], m = v[D][w];
(m < e[D][0] || m > e[D][1]) && (T = !1);
}
T && (l[u++] = t.getRawIndex(y));
}
return u < o && (t._indices = l), t._count = u, t._extent = [], t._updateGetRawIdx(), t;
}, r.prototype.map = function(e, t) {
var n = this.clone(e);
return this._updateDims(n, e, t), n;
}, r.prototype.modify = function(e, t) {
this._updateDims(this, e, t);
}, r.prototype._updateDims = function(e, t, n) {
for (var a = e._chunks, i = [], o = t.length, s = e.count(), l = [], u = e._rawExtent, h = 0; h < t.length; h++)
u[t[h]] = Zi();
for (var f = 0; f < s; f++) {
for (var c = e.getRawIndex(f), v = 0; v < o; v++)
l[v] = a[t[v]][c];
l[o] = f;
var p = n && n.apply(null, l);
if (p != null) {
typeof p != "object" && (i[0] = p, p = i);
for (var h = 0; h < p.length; h++) {
var d = t[h], g = p[h], y = u[d], m = a[d];
m && (m[c] = g), g < y[0] && (y[0] = g), g > y[1] && (y[1] = g);
}
}
}
}, r.prototype.lttbDownSample = function(e, t) {
var n = this.clone([e], !0), a = n._chunks, i = a[e], o = this.count(), s = 0, l = Math.floor(1 / t), u = this.getRawIndex(0), h, f, c, v = new (Yi(this._rawCount))(Math.min((Math.ceil(o / l) + 2) * 2, o));
v[s++] = u;
for (var p = 1; p < o - 1; p += l) {
for (var d = Math.min(p + l, o - 1), g = Math.min(p + l * 2, o), y = (g + d) / 2, m = 0, _ = d; _ < g; _++) {
var S = this.getRawIndex(_), x = i[S];
isNaN(x) || (m += x);
}
m /= g - d;
var b = p, w = Math.min(p + l, o), T = p - 1, C = i[u];
h = -1, c = b;
for (var D = -1, M = 0, _ = b; _ < w; _++) {
var S = this.getRawIndex(_), x = i[S];
if (isNaN(x)) {
M++, D < 0 && (D = S);
continue;
}
f = Math.abs((T - y) * (x - C) - (T - _) * (m - C)), f > h && (h = f, c = S);
}
M > 0 && M < w - b && (v[s++] = Math.min(D, c), c = Math.max(D, c)), v[s++] = c, u = c;
}
return v[s++] = this.getRawIndex(o - 1), n._count = s, n._indices = v, n.getRawIndex = this._getRawIdx, n;
}, r.prototype.minmaxDownSample = function(e, t) {
for (var n = this.clone([e], !0), a = n._chunks, i = Math.floor(1 / t), o = a[e], s = this.count(), l = new (Yi(this._rawCount))(Math.ceil(s / i) * 2), u = 0, h = 0; h < s; h += i) {
var f = h, c = o[this.getRawIndex(f)], v = h, p = o[this.getRawIndex(v)], d = i;
h + i > s && (d = s - h);
for (var g = 0; g < d; g++) {
var y = this.getRawIndex(h + g), m = o[y];
m < c && (c = m, f = h + g), m > p && (p = m, v = h + g);
}
var _ = this.getRawIndex(f), S = this.getRawIndex(v);
f < v ? (l[u++] = _, l[u++] = S) : (l[u++] = S, l[u++] = _);
}
return n._count = u, n._indices = l, n._updateGetRawIdx(), n;
}, r.prototype.downSample = function(e, t, n, a) {
for (var i = this.clone([e], !0), o = i._chunks, s = [], l = Math.floor(1 / t), u = o[e], h = this.count(), f = i._rawExtent[e] = Zi(), c = new (Yi(this._rawCount))(Math.ceil(h / l)), v = 0, p = 0; p < h; p += l) {
l > h - p && (l = h - p, s.length = l);
for (var d = 0; d < l; d++) {
var g = this.getRawIndex(p + d);
s[d] = u[g];
}
var y = n(s), m = this.getRawIndex(Math.min(p + a(s, y) || 0, h - 1));
u[m] = y, y < f[0] && (f[0] = y), y > f[1] && (f[1] = y), c[v++] = m;
}
return i._count = v, i._indices = c, i._updateGetRawIdx(), i;
}, r.prototype.each = function(e, t) {
if (this._count)
for (var n = e.length, a = this._chunks, i = 0, o = this.count(); i < o; i++) {
var s = this.getRawIndex(i);
switch (n) {
case 0:
t(i);
break;
case 1:
t(a[e[0]][s], i);
break;
case 2:
t(a[e[0]][s], a[e[1]][s], i);
break;
default:
for (var l = 0, u = []; l < n; l++)
u[l] = a[e[l]][s];
u[l] = i, t.apply(null, u);
}
}
}, r.prototype.getDataExtent = function(e) {
var t = this._chunks[e], n = Zi();
if (!t)
return n;
var a = this.count(), i = !this._indices, o;
if (i)
return this._rawExtent[e].slice();
if (o = this._extent[e], o)
return o.slice();
o = n;
for (var s = o[0], l = o[1], u = 0; u < a; u++) {
var h = this.getRawIndex(u), f = t[h];
f < s && (s = f), f > l && (l = f);
}
return o = [s, l], this._extent[e] = o, o;
}, r.prototype.getRawDataItem = function(e) {
var t = this.getRawIndex(e);
if (this._provider.persistent)
return this._provider.getItem(t);
for (var n = [], a = this._chunks, i = 0; i < a.length; i++)
n.push(a[i][t]);
return n;
}, r.prototype.clone = function(e, t) {
var n = new r(), a = this._chunks, i = e && rn(e, function(s, l) {
return s[l] = !0, s;
}, {});
if (i)
for (var o = 0; o < a.length; o++)
n._chunks[o] = i[o] ? EO(a[o]) : a[o];
else
n._chunks = a;
return this._copyCommonProps(n), t || (n._indices = this._cloneIndices()), n._updateGetRawIdx(), n;
}, r.prototype._copyCommonProps = function(e) {
e._count = this._count, e._rawCount = this._rawCount, e._provider = this._provider, e._dimensions = this._dimensions, e._extent = nt(this._extent), e._rawExtent = nt(this._rawExtent);
}, r.prototype._cloneIndices = function() {
if (this._indices) {
var e = this._indices.constructor, t = void 0;
if (e === Array) {
var n = this._indices.length;
t = new e(n);
for (var a = 0; a < n; a++)
t[a] = this._indices[a];
} else
t = new e(this._indices);
return t;
}
return null;
}, r.prototype._getRawIdxIdentity = function(e) {
return e;
}, r.prototype._getRawIdx = function(e) {
return e < this._count && e >= 0 ? this._indices[e] : -1;
}, r.prototype._updateGetRawIdx = function() {
this.getRawIndex = this._indices ? this._getRawIdx : this._getRawIdxIdentity;
}, r.internalField = function() {
function e(t, n, a, i) {
return sa(t[i], this._dimensions[i]);
}
vv = {
arrayRows: e,
objectRows: function(t, n, a, i) {
return sa(t[n], this._dimensions[i]);
},
keyedColumns: e,
original: function(t, n, a, i) {
var o = t && (t.value == null ? t : t.value);
return sa(o instanceof Array ? o[i] : o, this._dimensions[i]);
},
typedArray: function(t, n, a, i) {
return t[i];
}
};
}(), r;
}()
), ZD = (
/** @class */
function() {
function r(e) {
this._sourceList = [], this._storeList = [], this._upstreamSignList = [], this._versionSignBase = 0, this._dirty = !0, this._sourceHost = e;
}
return r.prototype.dirty = function() {
this._setLocalSource([], []), this._storeList = [], this._dirty = !0;
}, r.prototype._setLocalSource = function(e, t) {
this._sourceList = e, this._upstreamSignList = t, this._versionSignBase++, this._versionSignBase > 9e10 && (this._versionSignBase = 0);
}, r.prototype._getVersionSign = function() {
return this._sourceHost.uid + "_" + this._versionSignBase;
}, r.prototype.prepareSource = function() {
this._isDirty() && (this._createSource(), this._dirty = !1);
}, r.prototype._createSource = function() {
this._setLocalSource([], []);
var e = this._sourceHost, t = this._getUpstreamSourceManagers(), n = !!t.length, a, i;
if (fs(e)) {
var o = e, s = void 0, l = void 0, u = void 0;
if (n) {
var h = t[0];
h.prepareSource(), u = h.getSource(), s = u.data, l = u.sourceFormat, i = [h._getVersionSign()];
} else
s = o.get("data", !0), l = Ve(s) ? wn : br, i = [];
var f = this._getSourceMetaRawOption() || {}, c = u && u.metaRawOption || {}, v = ot(f.seriesLayoutBy, c.seriesLayoutBy) || null, p = ot(f.sourceHeader, c.sourceHeader), d = ot(f.dimensions, c.dimensions), g = v !== c.seriesLayoutBy || !!p != !!c.sourceHeader || d;
a = g ? [Vd(s, {
seriesLayoutBy: v,
sourceHeader: p,
dimensions: d
}, l)] : [];
} else {
var y = e;
if (n) {
var m = this._applyTransform(t);
a = m.sourceList, i = m.upstreamSignList;
} else {
var _ = y.get("source", !0);
a = [Vd(_, this._getSourceMetaRawOption(), null)], i = [];
}
}
process.env.NODE_ENV !== "production" && tt(a && i), this._setLocalSource(a, i);
}, r.prototype._applyTransform = function(e) {
var t = this._sourceHost, n = t.get("transform", !0), a = t.get("fromTransformResult", !0);
if (process.env.NODE_ENV !== "production" && tt(a != null || n != null), a != null) {
var i = "";
e.length !== 1 && (process.env.NODE_ENV !== "production" && (i = "When using `fromTransformResult`, there should be only one upstream dataset"), n1(i));
}
var o, s = [], l = [];
return A(e, function(u) {
u.prepareSource();
var h = u.getSource(a || 0), f = "";
a != null && !h && (process.env.NODE_ENV !== "production" && (f = "Can not retrieve result by `fromTransformResult`: " + a), n1(f)), s.push(h), l.push(u._getVersionSign());
}), n ? o = AO(n, s, {
datasetIndex: t.componentIndex
}) : a != null && (o = [lO(s[0])]), {
sourceList: o,
upstreamSignList: l
};
}, r.prototype._isDirty = function() {
if (this._dirty)
return !0;
for (var e = this._getUpstreamSourceManagers(), t = 0; t < e.length; t++) {
var n = e[t];
if (
// Consider the case that there is ancestor diry, call it recursively.
// The performance is probably not an issue because usually the chain is not long.
n._isDirty() || this._upstreamSignList[t] !== n._getVersionSign()
)
return !0;
}
}, r.prototype.getSource = function(e) {
e = e || 0;
var t = this._sourceList[e];
if (!t) {
var n = this._getUpstreamSourceManagers();
return n[0] && n[0].getSource(e);
}
return t;
}, r.prototype.getSharedDataStore = function(e) {
process.env.NODE_ENV !== "production" && tt(fs(this._sourceHost), "Can only call getDataStore on series source manager.");
var t = e.makeStoreSchema();
return this._innerGetDataStore(t.dimensions, e.source, t.hash);
}, r.prototype._innerGetDataStore = function(e, t, n) {
var a = 0, i = this._storeList, o = i[a];
o || (o = i[a] = {});
var s = o[n];
if (!s) {
var l = this._getUpstreamSourceManagers()[0];
fs(this._sourceHost) && l ? s = l._innerGetDataStore(e, t, n) : (s = new Bd(), s.initData(new VD(t, e.length), e)), o[n] = s;
}
return s;
}, r.prototype._getUpstreamSourceManagers = function() {
var e = this._sourceHost;
if (fs(e)) {
var t = Ly(e);
return t ? [t.getSourceManager()] : [];
} else
return G(NN(e), function(n) {
return n.getSourceManager();
});
}, r.prototype._getSourceMetaRawOption = function() {
var e = this._sourceHost, t, n, a;
if (fs(e))
t = e.get("seriesLayoutBy", !0), n = e.get("sourceHeader", !0), a = e.get("dimensions", !0);
else if (!this._getUpstreamSourceManagers().length) {
var i = e;
t = i.get("seriesLayoutBy", !0), n = i.get("sourceHeader", !0), a = i.get("dimensions", !0);
}
return {
seriesLayoutBy: t,
sourceHeader: n,
dimensions: a
};
}, r;
}()
);
function r1(r) {
var e = r.option.transform;
e && Ih(r.option.transform);
}
function fs(r) {
return r.mainType === "series";
}
function n1(r) {
throw new Error(r);
}
var PO = "line-height:1";
function XD(r) {
var e = r.lineHeight;
return e == null ? PO : "line-height:" + ke(e + "") + "px";
}
function qD(r, e) {
var t = r.color || "#6e7079", n = r.fontSize || 12, a = r.fontWeight || "400", i = r.color || "#464646", o = r.fontSize || 14, s = r.fontWeight || "900";
return e === "html" ? {
// eslint-disable-next-line max-len
nameStyle: "font-size:" + ke(n + "") + "px;color:" + ke(t) + ";font-weight:" + ke(a + ""),
// eslint-disable-next-line max-len
valueStyle: "font-size:" + ke(o + "") + "px;color:" + ke(i) + ";font-weight:" + ke(s + "")
} : {
nameStyle: {
fontSize: n,
fill: t,
fontWeight: a
},
valueStyle: {
fontSize: o,
fill: i,
fontWeight: s
}
};
}
var kO = [0, 10, 20, 30], RO = ["", `
`, `
`, `
`];
function pe(r, e) {
return e.type = r, e;
}
function zd(r) {
return r.type === "section";
}
function KD(r) {
return zd(r) ? NO : OO;
}
function jD(r) {
if (zd(r)) {
var e = 0, t = r.blocks.length, n = t > 1 || t > 0 && !r.noHeader;
return A(r.blocks, function(a) {
var i = jD(a);
i >= e && (e = i + +(n && // 0 always can not be readable gap level.
(!i || zd(a) && !a.noHeader)));
}), e;
}
return 0;
}
function NO(r, e, t, n) {
var a = e.noHeader, i = VO(jD(e)), o = [], s = e.blocks || [];
tt(!s || z(s)), s = s || [];
var l = r.orderMode;
if (e.sortBlocks && l) {
s = s.slice();
var u = {
valueAsc: "asc",
valueDesc: "desc"
};
if (Z(u, l)) {
var h = new WD(u[l], null);
s.sort(function(d, g) {
return h.evaluate(d.sortParam, g.sortParam);
});
} else l === "seriesDesc" && s.reverse();
}
A(s, function(d, g) {
var y = e.valueFormatter, m = KD(d)(
// Inherit valueFormatter
y ? B(B({}, r), {
valueFormatter: y
}) : r,
d,
g > 0 ? i.html : 0,
n
);
m != null && o.push(m);
});
var f = r.renderMode === "richText" ? o.join(i.richText) : Gd(n, o.join(""), a ? t : i.html);
if (a)
return f;
var c = kd(e.header, "ordinal", r.useUTC), v = qD(n, r.renderMode).nameStyle, p = XD(n);
return r.renderMode === "richText" ? QD(r, c, v) + i.richText + f : Gd(n, '<div style="' + v + ";" + p + ';">' + ke(c) + "</div>" + f, t);
}
function OO(r, e, t, n) {
var a = r.renderMode, i = e.noName, o = e.noValue, s = !e.markerType, l = e.name, u = r.useUTC, h = e.valueFormatter || r.valueFormatter || function(S) {
return S = z(S) ? S : [S], G(S, function(x, b) {
return kd(x, z(v) ? v[b] : v, u);
});
};
if (!(i && o)) {
var f = s ? "" : r.markupStyleCreator.makeTooltipMarker(e.markerType, e.markerColor || "#333", a), c = i ? "" : kd(l, "ordinal", u), v = e.valueType, p = o ? [] : h(e.value, e.dataIndex), d = !s || !i, g = !s && i, y = qD(n, a), m = y.nameStyle, _ = y.valueStyle;
return a === "richText" ? (s ? "" : f) + (i ? "" : QD(r, c, m)) + (o ? "" : GO(r, p, d, g, _)) : Gd(n, (s ? "" : f) + (i ? "" : BO(c, !s, m)) + (o ? "" : zO(p, d, g, _)), t);
}
}
function a1(r, e, t, n, a, i) {
if (r) {
var o = KD(r), s = {
useUTC: a,
renderMode: t,
orderMode: n,
markupStyleCreator: e,
valueFormatter: r.valueFormatter
};
return o(s, r, 0, i);
}
}
function VO(r) {
return {
html: kO[r],
richText: RO[r]
};
}
function Gd(r, e, t) {
var n = '<div style="clear:both"></div>', a = "margin: " + t + "px 0 0", i = XD(r);
return '<div style="' + a + ";" + i + ';">' + e + n + "</div>";
}
function BO(r, e, t) {
var n = e ? "margin-left:2px" : "";
return '<span style="' + t + ";" + n + '">' + ke(r) + "</span>";
}
function zO(r, e, t, n) {
var a = t ? "10px" : "20px", i = e ? "float:right;margin-left:" + a : "";
return r = z(r) ? r : [r], '<span style="' + i + ";" + n + '">' + G(r, function(o) {
return ke(o);
}).join(" ") + "</span>";
}
function QD(r, e, t) {
return r.markupStyleCreator.wrapRichTextStyle(e, t);
}
function GO(r, e, t, n, a) {
var i = [a], o = n ? 10 : 20;
return t && i.push({
padding: [0, 0, 0, o],
align: "right"
}), r.markupStyleCreator.wrapRichTextStyle(z(e) ? e.join(" ") : e, i);
}
function JD(r, e) {
var t = r.getData().getItemVisual(e, "style"), n = t[r.visualDrawType];
return Ci(n);
}
function tA(r, e) {
var t = r.get("padding");
return t ?? (e === "richText" ? [8, 10] : 10);
}
var pv = (
/** @class */
function() {
function r() {
this.richTextStyles = {}, this._nextStyleNameId = gC();
}
return r.prototype._generateStyleName = function() {
return "__EC_aUTo_" + this._nextStyleNameId++;
}, r.prototype.makeTooltipMarker = function(e, t, n) {
var a = n === "richText" ? this._generateStyleName() : null, i = MN({
color: t,
type: e,
renderMode: n,
markerId: a
});
return U(i) ? i : (process.env.NODE_ENV !== "production" && tt(a), this.richTextStyles[a] = i.style, i.content);
}, r.prototype.wrapRichTextStyle = function(e, t) {
var n = {};
z(t) ? A(t, function(i) {
return B(n, i);
}) : B(n, t);
var a = this._generateStyleName();
return this.richTextStyles[a] = n, "{" + a + "|" + e + "}";
}, r;
}()
);
function eA(r) {
var e = r.series, t = r.dataIndex, n = r.multipleSeries, a = e.getData(), i = a.mapDimensionsAll("defaultedTooltip"), o = i.length, s = e.getRawValue(t), l = z(s), u = JD(e, t), h, f, c, v;
if (o > 1 || l && !o) {
var p = FO(s, e, t, i, u);
h = p.inlineValues, f = p.inlineValueTypes, c = p.blocks, v = p.inlineValues[0];
} else if (o) {
var d = a.getDimensionInfo(i[0]);
v = h = Ao(a, t, i[0]), f = d.type;
} else
v = h = l ? s[0] : s;
var g = ly(e), y = g && e.name || "", m = a.getName(t), _ = n ? y : m;
return pe("section", {
header: y,
// When series name is not specified, do not show a header line with only '-'.
// This case always happens in tooltip.trigger: 'item'.
noHeader: n || !g,
sortParam: v,
blocks: [pe("nameValue", {
markerType: "item",
markerColor: u,
// Do not mix display seriesName and itemName in one tooltip,
// which might confuses users.
name: _,
// name dimension might be auto assigned, where the name might
// be not readable. So we check trim here.
noName: !Ir(_),
value: h,
valueType: f,
dataIndex: t
})].concat(c || [])
});
}
function FO(r, e, t, n, a) {
var i = e.getData(), o = rn(r, function(f, c, v) {
var p = i.getDimensionInfo(v);
return f = f || p && p.tooltip !== !1 && p.displayName != null;
}, !1), s = [], l = [], u = [];
n.length ? A(n, function(f) {
h(Ao(i, t, f), f);
}) : A(r, h);
function h(f, c) {
var v = i.getDimensionInfo(c);
!v || v.otherDims.tooltip === !1 || (o ? u.push(pe("nameValue", {
markerType: "subItem",
markerColor: a,
name: v.displayName,
value: f,
valueType: v.type
})) : (s.push(f), l.push(v.type)));
}
return {
inlineValues: s,
inlineValueTypes: l,
blocks: u
};
}
var Fn = bt();
function bu(r, e) {
return r.getName(e) || r.getId(e);
}
var yh = "__universalTransitionEnabled", Ft = (
/** @class */
function(r) {
O(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t._selectedDataIndicesMap = {}, t;
}
return e.prototype.init = function(t, n, a) {
this.seriesIndex = this.componentIndex, this.dataTask = tl({
count: WO,
reset: $O
}), this.dataTask.context = {
model: this
}, this.mergeDefaultAndTheme(t, a);
var i = Fn(this).sourceManager = new ZD(this);
i.prepareSource();
var o = this.getInitialData(t, a);
o1(o, this), this.dataTask.context.data = o, process.env.NODE_ENV !== "production" && tt(o, "getInitialData returned invalid data."), Fn(this).dataBeforeProcessed = o, i1(this), this._initSelectedMapFromData(o);
}, e.prototype.mergeDefaultAndTheme = function(t, n) {
var a = pl(this), i = a ? $o(t) : {}, o = this.subType;
_t.hasClass(o) && (o += "Series"), ht(t, n.getTheme().get(this.subType)), ht(t, this.getDefaultOption()), xi(t, "label", ["show"]), this.fillDataTextStyle(t.data), a && pa(t, i, a);
}, e.prototype.mergeOption = function(t, n) {
t = ht(this.option, t, !0), this.fillDataTextStyle(t.data);
var a = pl(this);
a && pa(this.option, t, a);
var i = Fn(this).sourceManager;
i.dirty(), i.prepareSource();
var o = this.getInitialData(t, n);
o1(o, this), this.dataTask.dirty(), this.dataTask.context.data = o, Fn(this).dataBeforeProcessed = o, i1(this), this._initSelectedMapFromData(o);
}, e.prototype.fillDataTextStyle = function(t) {
if (t && !Ve(t))
for (var n = ["show"], a = 0; a < t.length; a++)
t[a] && t[a].label && xi(t[a], "label", n);
}, e.prototype.getInitialData = function(t, n) {
}, e.prototype.appendData = function(t) {
var n = this.getRawData();
n.appendData(t.data);
}, e.prototype.getData = function(t) {
var n = Fd(this);
if (n) {
var a = n.context.data;
return t == null || !a.getLinkedData ? a : a.getLinkedData(t);
} else
return Fn(this).data;
}, e.prototype.getAllData = function() {
var t = this.getData();
return t && t.getLinkedDataAll ? t.getLinkedDataAll() : [{
data: t
}];
}, e.prototype.setData = function(t) {
var n = Fd(this);
if (n) {
var a = n.context;
a.outputData = t, n !== this.dataTask && (a.data = t);
}
Fn(this).data = t;
}, e.prototype.getEncode = function() {
var t = this.get("encode", !0);
if (t)
return X(t);
}, e.prototype.getSourceManager = function() {
return Fn(this).sourceManager;
}, e.prototype.getSource = function() {
return this.getSourceManager().getSource();
}, e.prototype.getRawData = function() {
return Fn(this).dataBeforeProcessed;
}, e.prototype.getColorBy = function() {
var t = this.get("colorBy");
return t || "series";
}, e.prototype.isColorBySeries = function() {
return this.getColorBy() === "series";
}, e.prototype.getBaseAxis = function() {
var t = this.coordinateSystem;
return t && t.getBaseAxis && t.getBaseAxis();
}, e.prototype.formatTooltip = function(t, n, a) {
return eA({
series: this,
dataIndex: t,
multipleSeries: n
});
}, e.prototype.isAnimationEnabled = function() {
var t = this.ecModel;
if (yt.node && !(t && t.ssr))
return !1;
var n = this.getShallow("animation");
return n && this.getData().count() > this.getShallow("animationThreshold") && (n = !1), !!n;
}, e.prototype.restoreData = function() {
this.dataTask.dirty();
}, e.prototype.getColorFromPalette = function(t, n, a) {
var i = this.ecModel, o = Ey.prototype.getColorFromPalette.call(this, t, n, a);
return o || (o = i.getColorFromPalette(t, n, a)), o;
}, e.prototype.coordDimToDataDim = function(t) {
return this.getRawData().mapDimensionsAll(t);
}, e.prototype.getProgressive = function() {
return this.get("progressive");
}, e.prototype.getProgressiveThreshold = function() {
return this.get("progressiveThreshold");
}, e.prototype.select = function(t, n) {
this._innerSelect(this.getData(n), t);
}, e.prototype.unselect = function(t, n) {
var a = this.option.selectedMap;
if (a) {
var i = this.option.selectedMode, o = this.getData(n);
if (i === "series" || a === "all") {
this.option.selectedMap = {}, this._selectedDataIndicesMap = {};
return;
}
for (var s = 0; s < t.length; s++) {
var l = t[s], u = bu(o, l);
a[u] = !1, this._selectedDataIndicesMap[u] = -1;
}
}
}, e.prototype.toggleSelect = function(t, n) {
for (var a = [], i = 0; i < t.length; i++)
a[0] = t[i], this.isSelected(t[i], n) ? this.unselect(a, n) : this.select(a, n);
}, e.prototype.getSelectedDataIndices = function() {
if (this.option.selectedMap === "all")
return [].slice.call(this.getData().getIndices());
for (var t = this._selectedDataIndicesMap, n = St(t), a = [], i = 0; i < n.length; i++) {
var o = t[n[i]];
o >= 0 && a.push(o);
}
return a;
}, e.prototype.isSelected = function(t, n) {
var a = this.option.selectedMap;
if (!a)
return !1;
var i = this.getData(n);
return (a === "all" || a[bu(i, t)]) && !i.getItemModel(t).get(["select", "disabled"]);
}, e.prototype.isUniversalTransitionEnabled = function() {
if (this[yh])
return !0;
var t = this.option.universalTransition;
return t ? t === !0 ? !0 : t && t.enabled : !1;
}, e.prototype._innerSelect = function(t, n) {
var a, i, o = this.option, s = o.selectedMode, l = n.length;
if (!(!s || !l)) {
if (s === "series")
o.selectedMap = "all";
else if (s === "multiple") {
J(o.selectedMap) || (o.selectedMap = {});
for (var u = o.selectedMap, h = 0; h < l; h++) {
var f = n[h], c = bu(t, f);
u[c] = !0, this._selectedDataIndicesMap[c] = t.getRawIndex(f);
}
} else if (s === "single" || s === !0) {
var v = n[l - 1], c = bu(t, v);
o.selectedMap = (a = {}, a[c] = !0, a), this._selectedDataIndicesMap = (i = {}, i[c] = t.getRawIndex(v), i);
}
}
}, e.prototype._initSelectedMapFromData = function(t) {
if (!this.option.selectedMap) {
var n = [];
t.hasItemOption && t.each(function(a) {
var i = t.getRawDataItem(a);
i && i.selected && n.push(a);
}), n.length > 0 && this._innerSelect(t, n);
}
}, e.registerClass = function(t) {
return _t.registerClass(t);
}, e.protoInitialize = function() {
var t = e.prototype;
t.type = "series.__base__", t.seriesIndex = 0, t.ignoreStyleOnData = !1, t.hasSymbolVisual = !1, t.defaultSymbol = "circle", t.visualStyleAccessPath = "itemStyle", t.visualDrawType = "fill";
}(), e;
}(_t)
);
ie(Ft, nc);
ie(Ft, Ey);
CC(Ft, _t);
function i1(r) {
var e = r.name;
ly(r) || (r.name = HO(r) || e);
}
function HO(r) {
var e = r.getRawData(), t = e.mapDimensionsAll("seriesName"), n = [];
return A(t, function(a) {
var i = e.getDimensionInfo(a);
i.displayName && n.push(i.displayName);
}), n.join(" ");
}
function WO(r) {
return r.model.getRawData().count();
}
function $O(r) {
var e = r.model;
return e.setData(e.getRawData().cloneShallow()), UO;
}
function UO(r, e) {
e.outputData && r.end > e.outputData.count() && e.model.getRawData().cloneShallow(e.outputData);
}
function o1(r, e) {
A(ol(r.CHANGABLE_METHODS, r.DOWNSAMPLE_METHODS), function(t) {
r.wrapMethod(t, ut(YO, e));
});
}
function YO(r, e) {
var t = Fd(r);
return t && t.setOutputEnd((e || this).count()), e;
}
function Fd(r) {
var e = (r.ecModel || {}).scheduler, t = e && e.getPipeline(r.uid);
if (t) {
var n = t.currentTask;
if (n) {
var a = n.agentStubMap;
a && (n = a.get(r.uid));
}
return n;
}
}
var Yt = (
/** @class */
function() {
function r() {
this.group = new at(), this.uid = Ho("viewComponent");
}
return r.prototype.init = function(e, t) {
}, r.prototype.render = function(e, t, n, a) {
}, r.prototype.dispose = function(e, t) {
}, r.prototype.updateView = function(e, t, n, a) {
}, r.prototype.updateLayout = function(e, t, n, a) {
}, r.prototype.updateVisual = function(e, t, n, a) {
}, r.prototype.toggleBlurSeries = function(e, t, n) {
}, r.prototype.eachRendered = function(e) {
var t = this.group;
t && t.traverse(e);
}, r;
}()
);
hy(Yt);
zf(Yt);
function Zo() {
var r = bt();
return function(e) {
var t = r(e), n = e.pipelineContext, a = !!t.large, i = !!t.progressiveRender, o = t.large = !!(n && n.large), s = t.progressiveRender = !!(n && n.progressiveRender);
return (a !== o || i !== s) && "reset";
};
}
var rA = bt(), ZO = Zo(), kt = (
/** @class */
function() {
function r() {
this.group = new at(), this.uid = Ho("viewChart"), this.renderTask = tl({
plan: XO,
reset: qO
}), this.renderTask.context = {
view: this
};
}
return r.prototype.init = function(e, t) {
}, r.prototype.render = function(e, t, n, a) {
if (process.env.NODE_ENV !== "production")
throw new Error("render method must been implemented");
}, r.prototype.highlight = function(e, t, n, a) {
var i = e.getData(a && a.dataType);
if (!i) {
process.env.NODE_ENV !== "production" && _e("Unknown dataType " + a.dataType);
return;
}
l1(i, a, "emphasis");
}, r.prototype.downplay = function(e, t, n, a) {
var i = e.getData(a && a.dataType);
if (!i) {
process.env.NODE_ENV !== "production" && _e("Unknown dataType " + a.dataType);
return;
}
l1(i, a, "normal");
}, r.prototype.remove = function(e, t) {
this.group.removeAll();
}, r.prototype.dispose = function(e, t) {
}, r.prototype.updateView = function(e, t, n, a) {
this.render(e, t, n, a);
}, r.prototype.updateLayout = function(e, t, n, a) {
this.render(e, t, n, a);
}, r.prototype.updateVisual = function(e, t, n, a) {
this.render(e, t, n, a);
}, r.prototype.eachRendered = function(e) {
ma(this.group, e);
}, r.markUpdateMethod = function(e, t) {
rA(e).updateMethod = t;
}, r.protoInitialize = function() {
var e = r.prototype;
e.type = "chart";
}(), r;
}()
);
function s1(r, e, t) {
r && ca(r) && (e === "emphasis" ? Mn : In)(r, t);
}
function l1(r, e, t) {
var n = bi(r, e), a = e && e.highlightKey != null ? MR(e.highlightKey) : null;
n != null ? A(Pt(n), function(i) {
s1(r.getItemGraphicEl(i), t, a);
}) : r.eachItemGraphicEl(function(i) {
s1(i, t, a);
});
}
hy(kt, ["dispose"]);
zf(kt);
function XO(r) {
return ZO(r.model);
}
function qO(r) {
var e = r.model, t = r.ecModel, n = r.api, a = r.payload, i = e.pipelineContext.progressiveRender, o = r.view, s = a && rA(a).updateMethod, l = i ? "incrementalPrepareRender" : s && o[s] ? s : "render";
return l !== "render" && o[l](e, t, n, a), KO[l];
}
var KO = {
incrementalPrepareRender: {
progress: function(r, e) {
e.view.incrementalRender(r, e.model, e.ecModel, e.api, e.payload);
}
},
render: {
// Put view.render in `progress` to support appendData. But in this case
// view.render should not be called in reset, otherwise it will be called
// twise. Use `forceFirstProgress` to make sure that view.render is called
// in any cases.
forceFirstProgress: !0,
progress: function(r, e) {
e.view.render(e.model, e.ecModel, e.api, e.payload);
}
}
}, Yh = "\0__throttleOriginMethod", u1 = "\0__throttleRate", h1 = "\0__throttleType";
function Vy(r, e, t) {
var n, a = 0, i = 0, o = null, s, l, u, h;
e = e || 0;
function f() {
i = (/* @__PURE__ */ new Date()).getTime(), o = null, r.apply(l, u || []);
}
var c = function() {
for (var v = [], p = 0; p < arguments.length; p++)
v[p] = arguments[p];
n = (/* @__PURE__ */ new Date()).getTime(), l = this, u = v;
var d = h || e, g = h || t;
h = null, s = n - (g ? a : i) - d, clearTimeout(o), g ? o = setTimeout(f, d) : s >= 0 ? f() : o = setTimeout(f, -s), a = n;
};
return c.clear = function() {
o && (clearTimeout(o), o = null);
}, c.debounceNextCall = function(v) {
h = v;
}, c;
}
function Xo(r, e, t, n) {
var a = r[e];
if (a) {
var i = a[Yh] || a, o = a[h1], s = a[u1];
if (s !== t || o !== n) {
if (t == null || !n)
return r[e] = i;
a = r[e] = Vy(i, t, n === "debounce"), a[Yh] = i, a[h1] = n, a[u1] = t;
}
return a;
}
}
function gl(r, e) {
var t = r[e];
t && t[Yh] && (t.clear && t.clear(), r[e] = t[Yh]);
}
var f1 = bt(), c1 = {
itemStyle: wi(uD, !0),
lineStyle: wi(lD, !0)
}, jO = {
lineStyle: "stroke",
itemStyle: "fill"
};
function nA(r, e) {
var t = r.visualStyleMapper || c1[e];
return t || (console.warn("Unknown style type '" + e + "'."), c1.itemStyle);
}
function aA(r, e) {
var t = r.visualDrawType || jO[e];
return t || (console.warn("Unknown style type '" + e + "'."), "fill");
}
var QO = {
createOnAllSeries: !0,
performRawSeries: !0,
reset: function(r, e) {
var t = r.getData(), n = r.visualStyleAccessPath || "itemStyle", a = r.getModel(n), i = nA(r, n), o = i(a), s = a.getShallow("decal");
s && (t.setVisual("decal", s), s.dirty = !0);
var l = aA(r, n), u = o[l], h = K(u) ? u : null, f = o.fill === "auto" || o.stroke === "auto";
if (!o[l] || h || f) {
var c = r.getColorFromPalette(
// TODO series count changed.
r.name,
null,
e.getSeriesCount()
);
o[l] || (o[l] = c, t.setVisual("colorFromPalette", !0)), o.fill = o.fill === "auto" || K(o.fill) ? c : o.fill, o.stroke = o.stroke === "auto" || K(o.stroke) ? c : o.stroke;
}
if (t.setVisual("style", o), t.setVisual("drawType", l), !e.isSeriesFiltered(r) && h)
return t.setVisual("colorFromPalette", !1), {
dataEach: function(v, p) {
var d = r.getDataParams(p), g = B({}, o);
g[l] = h(d), v.setItemVisual(p, "style", g);
}
};
}
}, cs = new It(), JO = {
createOnAllSeries: !0,
performRawSeries: !0,
reset: function(r, e) {
if (!(r.ignoreStyleOnData || e.isSeriesFiltered(r))) {
var t = r.getData(), n = r.visualStyleAccessPath || "itemStyle", a = nA(r, n), i = t.getVisual("drawType");
return {
dataEach: t.hasItemOption ? function(o, s) {
var l = o.getRawDataItem(s);
if (l && l[n]) {
cs.option = l[n];
var u = a(cs), h = o.ensureUniqueItemVisual(s, "style");
B(h, u), cs.option.decal && (o.setItemVisual(s, "decal", cs.option.decal), cs.option.decal.dirty = !0), i in u && o.setItemVisual(s, "colorFromPalette", !1);
}
} : null
};
}
}
}, tV = {
performRawSeries: !0,
overallReset: function(r) {
var e = X();
r.eachSeries(function(t) {
var n = t.getColorBy();
if (!t.isColorBySeries()) {
var a = t.type + "-" + n, i = e.get(a);
i || (i = {}, e.set(a, i)), f1(t).scope = i;
}
}), r.eachSeries(function(t) {
if (!(t.isColorBySeries() || r.isSeriesFiltered(t))) {
var n = t.getRawData(), a = {}, i = t.getData(), o = f1(t).scope, s = t.visualStyleAccessPath || "itemStyle", l = aA(t, s);
i.each(function(u) {
var h = i.getRawIndex(u);
a[h] = u;
}), n.each(function(u) {
var h = a[u], f = i.getItemVisual(h, "colorFromPalette");
if (f) {
var c = i.ensureUniqueItemVisual(h, "style"), v = n.getName(u) || u + "", p = n.count();
c[l] = t.getColorFromPalette(v, o, p);
}
});
}
});
}
}, wu = Math.PI;
function eV(r, e) {
e = e || {}, et(e, {
text: "loading",
textColor: "#000",
fontSize: 12,
fontWeight: "normal",
fontStyle: "normal",
fontFamily: "sans-serif",
maskColor: "rgba(255, 255, 255, 0.8)",
showSpinner: !0,
color: "#5470c6",
spinnerRadius: 10,
lineWidth: 5,
zlevel: 0
});
var t = new at(), n = new xt({
style: {
fill: e.maskColor
},
zlevel: e.zlevel,
z: 1e4
});
t.add(n);
var a = new wt({
style: {
text: e.text,
fill: e.textColor,
fontSize: e.fontSize,
fontWeight: e.fontWeight,
fontStyle: e.fontStyle,
fontFamily: e.fontFamily
},
zlevel: e.zlevel,
z: 10001
}), i = new xt({
style: {
fill: "none"
},
textContent: a,
textConfig: {
position: "right",
distance: 10
},
zlevel: e.zlevel,
z: 10001
});
t.add(i);
var o;
return e.showSpinner && (o = new Yf({
shape: {
startAngle: -wu / 2,
endAngle: -wu / 2 + 0.1,
r: e.spinnerRadius
},
style: {
stroke: e.color,
lineCap: "round",
lineWidth: e.lineWidth
},
zlevel: e.zlevel,
z: 10001
}), o.animateShape(!0).when(1e3, {
endAngle: wu * 3 / 2
}).start("circularInOut"), o.animateShape(!0).when(1e3, {
startAngle: wu * 3 / 2
}).delay(300).start("circularInOut"), t.add(o)), t.resize = function() {
var s = a.getBoundingRect().width, l = e.showSpinner ? e.spinnerRadius : 0, u = (r.getWidth() - l * 2 - (e.showSpinner && s ? 10 : 0) - s) / 2 - (e.showSpinner && s ? 0 : 5 + s / 2) + (e.showSpinner ? 0 : s / 2) + (s ? 0 : l), h = r.getHeight() / 2;
e.showSpinner && o.setShape({
cx: u,
cy: h
}), i.setShape({
x: u - l,
y: h - l,
width: l * 2,
height: l * 2
}), n.setShape({
x: 0,
y: 0,
width: r.getWidth(),
height: r.getHeight()
});
}, t.resize(), t;
}
var iA = (
/** @class */
function() {
function r(e, t, n, a) {
this._stageTaskMap = X(), this.ecInstance = e, this.api = t, n = this._dataProcessorHandlers = n.slice(), a = this._visualHandlers = a.slice(), this._allHandlers = n.concat(a);
}
return r.prototype.restoreData = function(e, t) {
e.restoreData(t), this._stageTaskMap.each(function(n) {
var a = n.overallTask;
a && a.dirty();
});
}, r.prototype.getPerformArgs = function(e, t) {
if (e.__pipeline) {
var n = this._pipelineMap.get(e.__pipeline.id), a = n.context, i = !t && n.progressiveEnabled && (!a || a.progressiveRender) && e.__idxInPipeline > n.blockIndex, o = i ? n.step : null, s = a && a.modDataCount, l = s != null ? Math.ceil(s / o) : null;
return {
step: o,
modBy: l,
modDataCount: s
};
}
}, r.prototype.getPipeline = function(e) {
return this._pipelineMap.get(e);
}, r.prototype.updateStreamModes = function(e, t) {
var n = this._pipelineMap.get(e.uid), a = e.getData(), i = a.count(), o = n.progressiveEnabled && t.incrementalPrepareRender && i >= n.threshold, s = e.get("large") && i >= e.get("largeThreshold"), l = e.get("progressiveChunkMode") === "mod" ? i : null;
e.pipelineContext = n.context = {
progressiveRender: o,
modDataCount: l,
large: s
};
}, r.prototype.restorePipelines = function(e) {
var t = this, n = t._pipelineMap = X();
e.eachSeries(function(a) {
var i = a.getProgressive(), o = a.uid;
n.set(o, {
id: o,
head: null,
tail: null,
threshold: a.getProgressiveThreshold(),
progressiveEnabled: i && !(a.preventIncremental && a.preventIncremental()),
blockIndex: -1,
step: Math.round(i || 700),
count: 0
}), t._pipe(a, a.dataTask);
});
}, r.prototype.prepareStageTasks = function() {
var e = this._stageTaskMap, t = this.api.getModel(), n = this.api;
A(this._allHandlers, function(a) {
var i = e.get(a.uid) || e.set(a.uid, {}), o = "";
process.env.NODE_ENV !== "production" && (o = '"reset" and "overallReset" must not be both specified.'), tt(!(a.reset && a.overallReset), o), a.reset && this._createSeriesStageTask(a, i, t, n), a.overallReset && this._createOverallStageTask(a, i, t, n);
}, this);
}, r.prototype.prepareView = function(e, t, n, a) {
var i = e.renderTask, o = i.context;
o.model = t, o.ecModel = n, o.api = a, i.__block = !e.incrementalPrepareRender, this._pipe(t, i);
}, r.prototype.performDataProcessorTasks = function(e, t) {
this._performStageTasks(this._dataProcessorHandlers, e, t, {
block: !0
});
}, r.prototype.performVisualTasks = function(e, t, n) {
this._performStageTasks(this._visualHandlers, e, t, n);
}, r.prototype._performStageTasks = function(e, t, n, a) {
a = a || {};
var i = !1, o = this;
A(e, function(l, u) {
if (!(a.visualType && a.visualType !== l.visualType)) {
var h = o._stageTaskMap.get(l.uid), f = h.seriesTaskMap, c = h.overallTask;
if (c) {
var v, p = c.agentStubMap;
p.each(function(g) {
s(a, g) && (g.dirty(), v = !0);
}), v && c.dirty(), o.updatePayload(c, n);
var d = o.getPerformArgs(c, a.block);
p.each(function(g) {
g.perform(d);
}), c.perform(d) && (i = !0);
} else f && f.each(function(g, y) {
s(a, g) && g.dirty();
var m = o.getPerformArgs(g, a.block);
m.skip = !l.performRawSeries && t.isSeriesFiltered(g.context.model), o.updatePayload(g, n), g.perform(m) && (i = !0);
});
}
});
function s(l, u) {
return l.setDirty && (!l.dirtyMap || l.dirtyMap.get(u.__pipeline.id));
}
this.unfinished = i || this.unfinished;
}, r.prototype.performSeriesTasks = function(e) {
var t;
e.eachSeries(function(n) {
t = n.dataTask.perform() || t;
}), this.unfinished = t || this.unfinished;
}, r.prototype.plan = function() {
this._pipelineMap.each(function(e) {
var t = e.tail;
do {
if (t.__block) {
e.blockIndex = t.__idxInPipeline;
break;
}
t = t.getUpstream();
} while (t);
});
}, r.prototype.updatePayload = function(e, t) {
t !== "remain" && (e.context.payload = t);
}, r.prototype._createSeriesStageTask = function(e, t, n, a) {
var i = this, o = t.seriesTaskMap, s = t.seriesTaskMap = X(), l = e.seriesType, u = e.getTargetSeries;
e.createOnAllSeries ? n.eachRawSeries(h) : l ? n.eachRawSeriesByType(l, h) : u && u(n, a).each(h);
function h(f) {
var c = f.uid, v = s.set(c, o && o.get(c) || tl({
plan: oV,
reset: sV,
count: uV
}));
v.context = {
model: f,
ecModel: n,
api: a,
// PENDING: `useClearVisual` not used?
useClearVisual: e.isVisual && !e.isLayout,
plan: e.plan,
reset: e.reset,
scheduler: i
}, i._pipe(f, v);
}
}, r.prototype._createOverallStageTask = function(e, t, n, a) {
var i = this, o = t.overallTask = t.overallTask || tl({
reset: rV
});
o.context = {
ecModel: n,
api: a,
overallReset: e.overallReset,
scheduler: i
};
var s = o.agentStubMap, l = o.agentStubMap = X(), u = e.seriesType, h = e.getTargetSeries, f = !0, c = !1, v = "";
process.env.NODE_ENV !== "production" && (v = '"createOnAllSeries" is not supported for "overallReset", because it will block all streams.'), tt(!e.createOnAllSeries, v), u ? n.eachRawSeriesByType(u, p) : h ? h(n, a).each(p) : (f = !1, A(n.getSeries(), p));
function p(d) {
var g = d.uid, y = l.set(g, s && s.get(g) || // When the result of `getTargetSeries` changed, the overallTask
// should be set as dirty and re-performed.
(c = !0, tl({
reset: nV,
onDirty: iV
})));
y.context = {
model: d,
overallProgress: f
// FIXME:TS never used, so comment it
// modifyOutputEnd: modifyOutputEnd
}, y.agent = o, y.__block = f, i._pipe(d, y);
}
c && o.dirty();
}, r.prototype._pipe = function(e, t) {
var n = e.uid, a = this._pipelineMap.get(n);
!a.head && (a.head = t), a.tail && a.tail.pipe(t), a.tail = t, t.__idxInPipeline = a.count++, t.__pipeline = a;
}, r.wrapStageHandler = function(e, t) {
return K(e) && (e = {
overallReset: e,
seriesType: hV(e)
}), e.uid = Ho("stageHandler"), t && (e.visualType = t), e;
}, r;
}()
);
function rV(r) {
r.overallReset(r.ecModel, r.api, r.payload);
}
function nV(r) {
return r.overallProgress && aV;
}
function aV() {
this.agent.dirty(), this.getDownstream().dirty();
}
function iV() {
this.agent && this.agent.dirty();
}
function oV(r) {
return r.plan ? r.plan(r.model, r.ecModel, r.api, r.payload) : null;
}
function sV(r) {
r.useClearVisual && r.data.clearAllVisual();
var e = r.resetDefines = Pt(r.reset(r.model, r.ecModel, r.api, r.payload));
return e.length > 1 ? G(e, function(t, n) {
return oA(n);
}) : lV;
}
var lV = oA(0);
function oA(r) {
return function(e, t) {
var n = t.data, a = t.resetDefines[r];
if (a && a.dataEach)
for (var i = e.start; i < e.end; i++)
a.dataEach(n, i);
else a && a.progress && a.progress(e, n);
};
}
function uV(r) {
return r.data.count();
}
function hV(r) {
Zh = null;
try {
r(yl, sA);
} catch {
}
return Zh;
}
var yl = {}, sA = {}, Zh;
lA(yl, Py);
lA(sA, PD);
yl.eachSeriesByType = yl.eachRawSeriesByType = function(r) {
Zh = r;
};
yl.eachComponent = function(r) {
r.mainType === "series" && r.subType && (Zh = r.subType);
};
function lA(r, e) {
for (var t in e.prototype)
r[t] = Jt;
}
var v1 = ["#37A2DA", "#32C5E9", "#67E0E3", "#9FE6B8", "#FFDB5C", "#ff9f7f", "#fb7293", "#E062AE", "#E690D1", "#e7bcf3", "#9d96f5", "#8378EA", "#96BFFF"];
const fV = {
color: v1,
colorLayer: [["#37A2DA", "#ffd85c", "#fd7b5f"], ["#37A2DA", "#67E0E3", "#FFDB5C", "#ff9f7f", "#E062AE", "#9d96f5"], ["#37A2DA", "#32C5E9", "#9FE6B8", "#FFDB5C", "#ff9f7f", "#fb7293", "#e7bcf3", "#8378EA", "#96BFFF"], v1]
};
var Te = "#B9B8CE", p1 = "#100C2A", Tu = function() {
return {
axisLine: {
lineStyle: {
color: Te
}
},
splitLine: {
lineStyle: {
color: "#484753"
}
},
splitArea: {
areaStyle: {
color: ["rgba(255,255,255,0.02)", "rgba(255,255,255,0.05)"]
}
},
minorSplitLine: {
lineStyle: {
color: "#20203B"
}
}
};
}, d1 = ["#4992ff", "#7cffb2", "#fddd60", "#ff6e76", "#58d9f9", "#05c091", "#ff8a45", "#8d48e3", "#dd79ff"], uA = {
darkMode: !0,
color: d1,
backgroundColor: p1,
axisPointer: {
lineStyle: {
color: "#817f91"
},
crossStyle: {
color: "#817f91"
},
label: {
// TODO Contrast of label backgorundColor
color: "#fff"
}
},
legend: {
textStyle: {
color: Te
},
pageTextStyle: {
color: Te
}
},
textStyle: {
color: Te
},
title: {
textStyle: {
color: "#EEF1FA"
},
subtextStyle: {
color: "#B9B8CE"
}
},
toolbox: {
iconStyle: {
borderColor: Te
}
},
dataZoom: {
borderColor: "#71708A",
textStyle: {
color: Te
},
brushStyle: {
color: "rgba(135,163,206,0.3)"
},
handleStyle: {
color: "#353450",
borderColor: "#C5CBE3"
},
moveHandleStyle: {
color: "#B0B6C3",
opacity: 0.3
},
fillerColor: "rgba(135,163,206,0.2)",
emphasis: {
handleStyle: {
borderColor: "#91B7F2",
color: "#4D587D"
},
moveHandleStyle: {
color: "#636D9A",
opacity: 0.7
}
},
dataBackground: {
lineStyle: {
color: "#71708A",
width: 1
},
areaStyle: {
color: "#71708A"
}
},
selectedDataBackground: {
lineStyle: {
color: "#87A3CE"
},
areaStyle: {
color: "#87A3CE"
}
}
},
visualMap: {
textStyle: {
color: Te
}
},
timeline: {
lineStyle: {
color: Te
},
label: {
color: Te
},
controlStyle: {
color: Te,
borderColor: Te
}
},
calendar: {
itemStyle: {
color: p1
},
dayLabel: {
color: Te
},
monthLabel: {
color: Te
},
yearLabel: {
color: Te
}
},
timeAxis: Tu(),
logAxis: Tu(),
valueAxis: Tu(),
categoryAxis: Tu(),
line: {
symbol: "circle"
},
graph: {
color: d1
},
gauge: {
title: {
color: Te
},
axisLine: {
lineStyle: {
color: [[1, "rgba(207,212,219,0.2)"]]
}
},
axisLabel: {
color: Te
},
detail: {
color: "#EEF1FA"
}
},
candlestick: {
itemStyle: {
color: "#f64e56",
color0: "#54ea92",
borderColor: "#f64e56",
borderColor0: "#54ea92"
// borderColor: '#ca2824',
// borderColor0: '#09a443'
}
}
};
uA.categoryAxis.splitLine.show = !1;
var cV = (
/** @class */
function() {
function r() {
}
return r.prototype.normalizeQuery = function(e) {
var t = {}, n = {}, a = {};
if (U(e)) {
var i = jr(e);
t.mainType = i.main || null, t.subType = i.sub || null;
} else {
var o = ["Index", "Name", "Id"], s = {
name: 1,
dataIndex: 1,
dataType: 1
};
A(e, function(l, u) {
for (var h = !1, f = 0; f < o.length; f++) {
var c = o[f], v = u.lastIndexOf(c);
if (v > 0 && v === u.length - c.length) {
var p = u.slice(0, v);
p !== "data" && (t.mainType = p, t[c.toLowerCase()] = l, h = !0);
}
}
s.hasOwnProperty(u) && (n[u] = l, h = !0), h || (a[u] = l);
});
}
return {
cptQuery: t,
dataQuery: n,
otherQuery: a
};
}, r.prototype.filter = function(e, t) {
var n = this.eventInfo;
if (!n)
return !0;
var a = n.targetEl, i = n.packedEvent, o = n.model, s = n.view;
if (!o || !s)
return !0;
var l = t.cptQuery, u = t.dataQuery;
return h(l, o, "mainType") && h(l, o, "subType") && h(l, o, "index", "componentIndex") && h(l, o, "name") && h(l, o, "id") && h(u, i, "name") && h(u, i, "dataIndex") && h(u, i, "dataType") && (!s.filterForExposedEvent || s.filterForExposedEvent(e, t.otherQuery, a, i));
function h(f, c, v, p) {
return f[v] == null || c[p || v] === f[v];
}
}, r.prototype.afterTrigger = function() {
this.eventInfo = null;
}, r;
}()
), Hd = ["symbol", "symbolSize", "symbolRotate", "symbolOffset"], g1 = Hd.concat(["symbolKeepAspect"]), vV = {
createOnAllSeries: !0,
// For legend.
performRawSeries: !0,
reset: function(r, e) {
var t = r.getData();
if (r.legendIcon && t.setVisual("legendIcon", r.legendIcon), !r.hasSymbolVisual)
return;
for (var n = {}, a = {}, i = !1, o = 0; o < Hd.length; o++) {
var s = Hd[o], l = r.get(s);
K(l) ? (i = !0, a[s] = l) : n[s] = l;
}
if (n.symbol = n.symbol || r.defaultSymbol, t.setVisual(B({
legendIcon: r.legendIcon || n.symbol,
symbolKeepAspect: r.get("symbolKeepAspect")
}, n)), e.isSeriesFiltered(r))
return;
var u = St(a);
function h(f, c) {
for (var v = r.getRawValue(c), p = r.getDataParams(c), d = 0; d < u.length; d++) {
var g = u[d];
f.setItemVisual(c, g, a[g](v, p));
}
}
return {
dataEach: i ? h : null
};
}
}, pV = {
createOnAllSeries: !0,
// For legend.
performRawSeries: !0,
reset: function(r, e) {
if (!r.hasSymbolVisual || e.isSeriesFiltered(r))
return;
var t = r.getData();
function n(a, i) {
for (var o = a.getItemModel(i), s = 0; s < g1.length; s++) {
var l = g1[s], u = o.getShallow(l, !0);
u != null && a.setItemVisual(i, l, u);
}
}
return {
dataEach: t.hasItemOption ? n : null
};
}
};
function By(r, e, t) {
switch (t) {
case "color":
var n = r.getItemVisual(e, "style");
return n[r.getVisual("drawType")];
case "opacity":
return r.getItemVisual(e, "style").opacity;
case "symbol":
case "symbolSize":
case "liftZ":
return r.getItemVisual(e, t);
default:
process.env.NODE_ENV !== "production" && console.warn("Unknown visual type " + t);
}
}
function Wl(r, e) {
switch (e) {
case "color":
var t = r.getVisual("style");
return t[r.getVisual("drawType")];
case "opacity":
return r.getVisual("style").opacity;
case "symbol":
case "symbolSize":
case "liftZ":
return r.getVisual(e);
default:
process.env.NODE_ENV !== "production" && console.warn("Unknown visual type " + e);
}
}
function hA(r, e, t, n) {
switch (t) {
case "color":
var a = r.ensureUniqueItemVisual(e, "style");
a[r.getVisual("drawType")] = n, r.setItemVisual(e, "colorFromPalette", !1);
break;
case "opacity":
r.ensureUniqueItemVisual(e, "style").opacity = n;
break;
case "symbol":
case "symbolSize":
case "liftZ":
r.setItemVisual(e, t, n);
break;
default:
process.env.NODE_ENV !== "production" && console.warn("Unknown visual type " + t);
}
}
function fA(r, e) {
function t(n, a) {
var i = [];
return n.eachComponent({
mainType: "series",
subType: r,
query: a
}, function(o) {
i.push(o.seriesIndex);
}), i;
}
A([[r + "ToggleSelect", "toggleSelect"], [r + "Select", "select"], [r + "UnSelect", "unselect"]], function(n) {
e(n[0], function(a, i, o) {
a = B({}, a), process.env.NODE_ENV !== "production" && ee(a.type, n[1]), o.dispatchAction(B(a, {
type: n[1],
seriesIndex: t(i, a)
}));
});
});
}
function Xi(r, e, t, n, a) {
var i = r + e;
t.isSilent(i) || (process.env.NODE_ENV !== "production" && Nr("event " + i + " is deprecated."), n.eachComponent({
mainType: "series",
subType: "pie"
}, function(o) {
for (var s = o.seriesIndex, l = o.option.selectedMap, u = a.selected, h = 0; h < u.length; h++)
if (u[h].seriesIndex === s) {
var f = o.getData(), c = bi(f, a.fromActionPayload);
t.trigger(i, {
type: i,
seriesId: o.id,
name: z(c) ? f.getName(c[0]) : f.getName(c),
selected: U(l) ? l : B({}, l)
});
}
}));
}
function dV(r, e, t) {
r.on("selectchanged", function(n) {
var a = t.getModel();
n.isFromClick ? (Xi("map", "selectchanged", e, a, n), Xi("pie", "selectchanged", e, a, n)) : n.fromAction === "select" ? (Xi("map", "selected", e, a, n), Xi("pie", "selected", e, a, n)) : n.fromAction === "unselect" && (Xi("map", "unselected", e, a, n), Xi("pie", "unselected", e, a, n));
});
}
function ii(r, e, t) {
for (var n; r && !(e(r) && (n = r, t)); )
r = r.__hostTarget || r.parent;
return n;
}
var gV = Math.round(Math.random() * 9), yV = typeof Object.defineProperty == "function", mV = function() {
function r() {
this._id = "__ec_inner_" + gV++;
}
return r.prototype.get = function(e) {
return this._guard(e)[this._id];
}, r.prototype.set = function(e, t) {
var n = this._guard(e);
return yV ? Object.defineProperty(n, this._id, {
value: t,
enumerable: !1,
configurable: !0
}) : n[this._id] = t, this;
}, r.prototype.delete = function(e) {
return this.has(e) ? (delete this._guard(e)[this._id], !0) : !1;
}, r.prototype.has = function(e) {
return !!this._guard(e)[this._id];
}, r.prototype._guard = function(e) {
if (e !== Object(e))
throw TypeError("Value of WeakMap is not a non-null object.");
return e;
}, r;
}(), _V = mt.extend({
type: "triangle",
shape: {
cx: 0,
cy: 0,
width: 0,
height: 0
},
buildPath: function(r, e) {
var t = e.cx, n = e.cy, a = e.width / 2, i = e.height / 2;
r.moveTo(t, n - i), r.lineTo(t + a, n + i), r.lineTo(t - a, n + i), r.closePath();
}
}), SV = mt.extend({
type: "diamond",
shape: {
cx: 0,
cy: 0,
width: 0,
height: 0
},
buildPath: function(r, e) {
var t = e.cx, n = e.cy, a = e.width / 2, i = e.height / 2;
r.moveTo(t, n - i), r.lineTo(t + a, n), r.lineTo(t, n + i), r.lineTo(t - a, n), r.closePath();
}
}), xV = mt.extend({
type: "pin",
shape: {
// x, y on the cusp
x: 0,
y: 0,
width: 0,
height: 0
},
buildPath: function(r, e) {
var t = e.x, n = e.y, a = e.width / 5 * 3, i = Math.max(a, e.height), o = a / 2, s = o * o / (i - o), l = n - i + o + s, u = Math.asin(s / o), h = Math.cos(u) * o, f = Math.sin(u), c = Math.cos(u), v = o * 0.6, p = o * 0.7;
r.moveTo(t - h, l + s), r.arc(t, l, o, Math.PI - u, Math.PI * 2 + u), r.bezierCurveTo(t + h - f * v, l + s + c * v, t, n - p, t, n), r.bezierCurveTo(t, n - p, t - h + f * v, l + s + c * v, t - h, l + s), r.closePath();
}
}), bV = mt.extend({
type: "arrow",
shape: {
x: 0,
y: 0,
width: 0,
height: 0
},
buildPath: function(r, e) {
var t = e.height, n = e.width, a = e.x, i = e.y, o = n / 3 * 2;
r.moveTo(a, i), r.lineTo(a + o, i + t), r.lineTo(a, i + t / 4 * 3), r.lineTo(a - o, i + t), r.lineTo(a, i), r.closePath();
}
}), wV = {
line: he,
rect: xt,
roundRect: xt,
square: xt,
circle: Nn,
diamond: SV,
pin: xV,
arrow: bV,
triangle: _V
}, TV = {
line: function(r, e, t, n, a) {
a.x1 = r, a.y1 = e + n / 2, a.x2 = r + t, a.y2 = e + n / 2;
},
rect: function(r, e, t, n, a) {
a.x = r, a.y = e, a.width = t, a.height = n;
},
roundRect: function(r, e, t, n, a) {
a.x = r, a.y = e, a.width = t, a.height = n, a.r = Math.min(t, n) / 4;
},
square: function(r, e, t, n, a) {
var i = Math.min(t, n);
a.x = r, a.y = e, a.width = i, a.height = i;
},
circle: function(r, e, t, n, a) {
a.cx = r + t / 2, a.cy = e + n / 2, a.r = Math.min(t, n) / 2;
},
diamond: function(r, e, t, n, a) {
a.cx = r + t / 2, a.cy = e + n / 2, a.width = t, a.height = n;
},
pin: function(r, e, t, n, a) {
a.x = r + t / 2, a.y = e + n / 2, a.width = t, a.height = n;
},
arrow: function(r, e, t, n, a) {
a.x = r + t / 2, a.y = e + n / 2, a.width = t, a.height = n;
},
triangle: function(r, e, t, n, a) {
a.cx = r + t / 2, a.cy = e + n / 2, a.width = t, a.height = n;
}
}, Xh = {};
A(wV, function(r, e) {
Xh[e] = new r();
});
var CV = mt.extend({
type: "symbol",
shape: {
symbolType: "",
x: 0,
y: 0,
width: 0,
height: 0
},
calculateTextPosition: function(r, e, t) {
var n = Oh(r, e, t), a = this.shape;
return a && a.symbolType === "pin" && e.position === "inside" && (n.y = t.y + t.height * 0.4), n;
},
buildPath: function(r, e, t) {
var n = e.symbolType;
if (n !== "none") {
var a = Xh[n];
a || (n = "rect", a = Xh[n]), TV[n](e.x, e.y, e.width, e.height, a.shape), a.buildPath(r, a.shape, t);
}
}
});
function DV(r, e) {
if (this.type !== "image") {
var t = this.style;
this.__isEmptyBrush ? (t.stroke = r, t.fill = e || "#fff", t.lineWidth = 2) : this.shape.symbolType === "line" ? t.stroke = r : t.fill = r, this.markRedraw();
}
}
function ae(r, e, t, n, a, i, o) {
var s = r.indexOf("empty") === 0;
s && (r = r.substr(5, 1).toLowerCase() + r.substr(6));
var l;
return r.indexOf("image://") === 0 ? l = tD(r.slice(8), new ct(e, t, n, a), o ? "center" : "cover") : r.indexOf("path://") === 0 ? l = Zf(r.slice(7), {}, new ct(e, t, n, a), o ? "center" : "cover") : l = new CV({
shape: {
symbolType: r,
x: e,
y: t,
width: n,
height: a
}
}), l.__isEmptyBrush = s, l.setColor = DV, i && l.setColor(i), l;
}
function qo(r) {
return z(r) || (r = [+r, +r]), [r[0] || 0, r[1] || 0];
}
function ki(r, e) {
if (r != null)
return z(r) || (r = [r, r]), [W(r[0], e[0]) || 0, W(ot(r[1], r[0]), e[1]) || 0];
}
function oi(r) {
return isFinite(r);
}
function AV(r, e, t) {
var n = e.x == null ? 0 : e.x, a = e.x2 == null ? 1 : e.x2, i = e.y == null ? 0 : e.y, o = e.y2 == null ? 0 : e.y2;
e.global || (n = n * t.width + t.x, a = a * t.width + t.x, i = i * t.height + t.y, o = o * t.height + t.y), n = oi(n) ? n : 0, a = oi(a) ? a : 1, i = oi(i) ? i : 0, o = oi(o) ? o : 0;
var s = r.createLinearGradient(n, i, a, o);
return s;
}
function MV(r, e, t) {
var n = t.width, a = t.height, i = Math.min(n, a), o = e.x == null ? 0.5 : e.x, s = e.y == null ? 0.5 : e.y, l = e.r == null ? 0.5 : e.r;
e.global || (o = o * n + t.x, s = s * a + t.y, l = l * i), o = oi(o) ? o : 0.5, s = oi(s) ? s : 0.5, l = l >= 0 && oi(l) ? l : 0.5;
var u = r.createRadialGradient(o, s, 0, o, s, l);
return u;
}
function Wd(r, e, t) {
for (var n = e.type === "radial" ? MV(r, e, t) : AV(r, e, t), a = e.colorStops, i = 0; i < a.length; i++)
n.addColorStop(a[i].offset, a[i].color);
return n;
}
function IV(r, e) {
if (r === e || !r && !e)
return !1;
if (!r || !e || r.length !== e.length)
return !0;
for (var t = 0; t < r.length; t++)
if (r[t] !== e[t])
return !0;
return !1;
}
function Cu(r) {
return parseInt(r, 10);
}
function go(r, e, t) {
var n = ["width", "height"][e], a = ["clientWidth", "clientHeight"][e], i = ["paddingLeft", "paddingTop"][e], o = ["paddingRight", "paddingBottom"][e];
if (t[n] != null && t[n] !== "auto")
return parseFloat(t[n]);
var s = document.defaultView.getComputedStyle(r);
return (r[a] || Cu(s[n]) || Cu(r.style[n])) - (Cu(s[i]) || 0) - (Cu(s[o]) || 0) | 0;
}
function LV(r, e) {
return !r || r === "solid" || !(e > 0) ? null : r === "dashed" ? [4 * e, 2 * e] : r === "dotted" ? [e] : Tt(r) ? [r] : z(r) ? r : null;
}
function zy(r) {
var e = r.style, t = e.lineDash && e.lineWidth > 0 && LV(e.lineDash, e.lineWidth), n = e.lineDashOffset;
if (t) {
var a = e.strokeNoScale && r.getLineScale ? r.getLineScale() : 1;
a && a !== 1 && (t = G(t, function(i) {
return i / a;
}), n /= a);
}
return [t, n];
}
var EV = new sn(!0);
function qh(r) {
var e = r.stroke;
return !(e == null || e === "none" || !(r.lineWidth > 0));
}
function y1(r) {
return typeof r == "string" && r !== "none";
}
function Kh(r) {
var e = r.fill;
return e != null && e !== "none";
}
function m1(r, e) {
if (e.fillOpacity != null && e.fillOpacity !== 1) {
var t = r.globalAlpha;
r.globalAlpha = e.fillOpacity * e.opacity, r.fill(), r.globalAlpha = t;
} else
r.fill();
}
function _1(r, e) {
if (e.strokeOpacity != null && e.strokeOpacity !== 1) {
var t = r.globalAlpha;
r.globalAlpha = e.strokeOpacity * e.opacity, r.stroke(), r.globalAlpha = t;
} else
r.stroke();
}
function $d(r, e, t) {
var n = fy(e.image, e.__image, t);
if (Gf(n)) {
var a = r.createPattern(n, e.repeat || "repeat");
if (typeof DOMMatrix == "function" && a && a.setTransform) {
var i = new DOMMatrix();
i.translateSelf(e.x || 0, e.y || 0), i.rotateSelf(0, 0, (e.rotation || 0) * ah), i.scaleSelf(e.scaleX || 1, e.scaleY || 1), a.setTransform(i);
}
return a;
}
}
function PV(r, e, t, n) {
var a, i = qh(t), o = Kh(t), s = t.strokePercent, l = s < 1, u = !e.path;
(!e.silent || l) && u && e.createPathProxy();
var h = e.path || EV, f = e.__dirty;
if (!n) {
var c = t.fill, v = t.stroke, p = o && !!c.colorStops, d = i && !!v.colorStops, g = o && !!c.image, y = i && !!v.image, m = void 0, _ = void 0, S = void 0, x = void 0, b = void 0;
(p || d) && (b = e.getBoundingRect()), p && (m = f ? Wd(r, c, b) : e.__canvasFillGradient, e.__canvasFillGradient = m), d && (_ = f ? Wd(r, v, b) : e.__canvasStrokeGradient, e.__canvasStrokeGradient = _), g && (S = f || !e.__canvasFillPattern ? $d(r, c, e) : e.__canvasFillPattern, e.__canvasFillPattern = S), y && (x = f || !e.__canvasStrokePattern ? $d(r, v, e) : e.__canvasStrokePattern, e.__canvasStrokePattern = S), p ? r.fillStyle = m : g && (S ? r.fillStyle = S : o = !1), d ? r.strokeStyle = _ : y && (x ? r.strokeStyle = x : i = !1);
}
var w = e.getGlobalScale();
h.setScale(w[0], w[1], e.segmentIgnoreThreshold);
var T, C;
r.setLineDash && t.lineDash && (a = zy(e), T = a[0], C = a[1]);
var D = !0;
(u || f & Ls) && (h.setDPR(r.dpr), l ? h.setContext(null) : (h.setContext(r), D = !1), h.reset(), e.buildPath(h, e.shape, n), h.toStatic(), e.pathUpdated()), D && h.rebuildPath(r, l ? s : 1), T && (r.setLineDash(T), r.lineDashOffset = C), n || (t.strokeFirst ? (i && _1(r, t), o && m1(r, t)) : (o && m1(r, t), i && _1(r, t))), T && r.setLineDash([]);
}
function kV(r, e, t) {
var n = e.__image = fy(t.image, e.__image, e, e.onload);
if (!(!n || !Gf(n))) {
var a = t.x || 0, i = t.y || 0, o = e.getWidth(), s = e.getHeight(), l = n.width / n.height;
if (o == null && s != null ? o = s * l : s == null && o != null ? s = o / l : o == null && s == null && (o = n.width, s = n.height), t.sWidth && t.sHeight) {
var u = t.sx || 0, h = t.sy || 0;
r.drawImage(n, u, h, t.sWidth, t.sHeight, a, i, o, s);
} else if (t.sx && t.sy) {
var u = t.sx, h = t.sy, f = o - u, c = s - h;
r.drawImage(n, u, h, f, c, a, i, o, s);
} else
r.drawImage(n, a, i, o, s);
}
}
function RV(r, e, t) {
var n, a = t.text;
if (a != null && (a += ""), a) {
r.font = t.font || ua, r.textAlign = t.textAlign, r.textBaseline = t.textBaseline;
var i = void 0, o = void 0;
r.setLineDash && t.lineDash && (n = zy(e), i = n[0], o = n[1]), i && (r.setLineDash(i), r.lineDashOffset = o), t.strokeFirst ? (qh(t) && r.strokeText(a, t.x, t.y), Kh(t) && r.fillText(a, t.x, t.y)) : (Kh(t) && r.fillText(a, t.x, t.y), qh(t) && r.strokeText(a, t.x, t.y)), i && r.setLineDash([]);
}
}
var S1 = ["shadowBlur", "shadowOffsetX", "shadowOffsetY"], x1 = [
["lineCap", "butt"],
["lineJoin", "miter"],
["miterLimit", 10]
];
function cA(r, e, t, n, a) {
var i = !1;
if (!n && (t = t || {}, e === t))
return !1;
if (n || e.opacity !== t.opacity) {
qe(r, a), i = !0;
var o = Math.max(Math.min(e.opacity, 1), 0);
r.globalAlpha = isNaN(o) ? fi.opacity : o;
}
(n || e.blend !== t.blend) && (i || (qe(r, a), i = !0), r.globalCompositeOperation = e.blend || fi.blend);
for (var s = 0; s < S1.length; s++) {
var l = S1[s];
(n || e[l] !== t[l]) && (i || (qe(r, a), i = !0), r[l] = r.dpr * (e[l] || 0));
}
return (n || e.shadowColor !== t.shadowColor) && (i || (qe(r, a), i = !0), r.shadowColor = e.shadowColor || fi.shadowColor), i;
}
function b1(r, e, t, n, a) {
var i = ml(e, a.inHover), o = n ? null : t && ml(t, a.inHover) || {};
if (i === o)
return !1;
var s = cA(r, i, o, n, a);
if ((n || i.fill !== o.fill) && (s || (qe(r, a), s = !0), y1(i.fill) && (r.fillStyle = i.fill)), (n || i.stroke !== o.stroke) && (s || (qe(r, a), s = !0), y1(i.stroke) && (r.strokeStyle = i.stroke)), (n || i.opacity !== o.opacity) && (s || (qe(r, a), s = !0), r.globalAlpha = i.opacity == null ? 1 : i.opacity), e.hasStroke()) {
var l = i.lineWidth, u = l / (i.strokeNoScale && e.getLineScale ? e.getLineScale() : 1);
r.lineWidth !== u && (s || (qe(r, a), s = !0), r.lineWidth = u);
}
for (var h = 0; h < x1.length; h++) {
var f = x1[h], c = f[0];
(n || i[c] !== o[c]) && (s || (qe(r, a), s = !0), r[c] = i[c] || f[1]);
}
return s;
}
function NV(r, e, t, n, a) {
return cA(r, ml(e, a.inHover), t && ml(t, a.inHover), n, a);
}
function vA(r, e) {
var t = e.transform, n = r.dpr || 1;
t ? r.setTransform(n * t[0], n * t[1], n * t[2], n * t[3], n * t[4], n * t[5]) : r.setTransform(n, 0, 0, n, 0, 0);
}
function OV(r, e, t) {
for (var n = !1, a = 0; a < r.length; a++) {
var i = r[a];
n = n || i.isZeroArea(), vA(e, i), e.beginPath(), i.buildPath(e, i.shape), e.clip();
}
t.allClipped = n;
}
function VV(r, e) {
return r && e ? r[0] !== e[0] || r[1] !== e[1] || r[2] !== e[2] || r[3] !== e[3] || r[4] !== e[4] || r[5] !== e[5] : !(!r && !e);
}
var w1 = 1, T1 = 2, C1 = 3, D1 = 4;
function BV(r) {
var e = Kh(r), t = qh(r);
return !(r.lineDash || !(+e ^ +t) || e && typeof r.fill != "string" || t && typeof r.stroke != "string" || r.strokePercent < 1 || r.strokeOpacity < 1 || r.fillOpacity < 1);
}
function qe(r, e) {
e.batchFill && r.fill(), e.batchStroke && r.stroke(), e.batchFill = "", e.batchStroke = "";
}
function ml(r, e) {
return e && r.__hoverStyle || r.style;
}
function pA(r, e) {
si(r, e, { inHover: !1, viewWidth: 0, viewHeight: 0 }, !0);
}
function si(r, e, t, n) {
var a = e.transform;
if (!e.shouldBePainted(t.viewWidth, t.viewHeight, !1, !1)) {
e.__dirty &= -2, e.__isRendered = !1;
return;
}
var i = e.__clipPaths, o = t.prevElClipPaths, s = !1, l = !1;
if ((!o || IV(i, o)) && (o && o.length && (qe(r, t), r.restore(), l = s = !0, t.prevElClipPaths = null, t.allClipped = !1, t.prevEl = null), i && i.length && (qe(r, t), r.save(), OV(i, r, t), s = !0), t.prevElClipPaths = i), t.allClipped) {
e.__isRendered = !1;
return;
}
e.beforeBrush && e.beforeBrush(), e.innerBeforeBrush();
var u = t.prevEl;
u || (l = s = !0);
var h = e instanceof mt && e.autoBatch && BV(e.style);
s || VV(a, u.transform) ? (qe(r, t), vA(r, e)) : h || qe(r, t);
var f = ml(e, t.inHover);
e instanceof mt ? (t.lastDrawType !== w1 && (l = !0, t.lastDrawType = w1), b1(r, e, u, l, t), (!h || !t.batchFill && !t.batchStroke) && r.beginPath(), PV(r, e, f, h), h && (t.batchFill = f.fill || "", t.batchStroke = f.stroke || "")) : e instanceof Co ? (t.lastDrawType !== C1 && (l = !0, t.lastDrawType = C1), b1(r, e, u, l, t), RV(r, e, f)) : e instanceof ge ? (t.lastDrawType !== T1 && (l = !0, t.lastDrawType = T1), NV(r, e, u, l, t), kV(r, e, f)) : e.getTemporalDisplayables && (t.lastDrawType !== D1 && (l = !0, t.lastDrawType = D1), zV(r, e, t)), h && n && qe(r, t), e.innerAfterBrush(), e.afterBrush && e.afterBrush(), t.prevEl = e, e.__dirty = 0, e.__isRendered = !0;
}
function zV(r, e, t) {
var n = e.getDisplayables(), a = e.getTemporalDisplayables();
r.save();
var i = {
prevElClipPaths: null,
prevEl: null,
allClipped: !1,
viewWidth: t.viewWidth,
viewHeight: t.viewHeight,
inHover: t.inHover
}, o, s;
for (o = e.getCursor(), s = n.length; o < s; o++) {
var l = n[o];
l.beforeBrush && l.beforeBrush(), l.innerBeforeBrush(), si(r, l, i, o === s - 1), l.innerAfterBrush(), l.afterBrush && l.afterBrush(), i.prevEl = l;
}
for (var u = 0, h = a.length; u < h; u++) {
var l = a[u];
l.beforeBrush && l.beforeBrush(), l.innerBeforeBrush(), si(r, l, i, u === h - 1), l.innerAfterBrush(), l.afterBrush && l.afterBrush(), i.prevEl = l;
}
e.clearTemporalDisplayables(), e.notClear = !0, r.restore();
}
var dv = new mV(), A1 = new Rl(100), M1 = ["symbol", "symbolSize", "symbolKeepAspect", "color", "backgroundColor", "dashArrayX", "dashArrayY", "maxTileWidth", "maxTileHeight"];
function Mo(r, e) {
if (r === "none")
return null;
var t = e.getDevicePixelRatio(), n = e.getZr(), a = n.painter.type === "svg";
r.dirty && dv.delete(r);
var i = dv.get(r);
if (i)
return i;
var o = et(r, {
symbol: "rect",
symbolSize: 1,
symbolKeepAspect: !0,
color: "rgba(0, 0, 0, 0.2)",
backgroundColor: null,
dashArrayX: 5,
dashArrayY: 5,
rotation: 0,
maxTileWidth: 512,
maxTileHeight: 512
});
o.backgroundColor === "none" && (o.backgroundColor = null);
var s = {
repeat: "repeat"
};
return l(s), s.rotation = o.rotation, s.scaleX = s.scaleY = a ? 1 : 1 / t, dv.set(r, s), r.dirty = !1, s;
function l(u) {
for (var h = [t], f = !0, c = 0; c < M1.length; ++c) {
var v = o[M1[c]];
if (v != null && !z(v) && !U(v) && !Tt(v) && typeof v != "boolean") {
f = !1;
break;
}
h.push(v);
}
var p;
if (f) {
p = h.join(",") + (a ? "-svg" : "");
var d = A1.get(p);
d && (a ? u.svgElement = d : u.image = d);
}
var g = gA(o.dashArrayX), y = GV(o.dashArrayY), m = dA(o.symbol), _ = FV(g), S = yA(y), x = !a && ha.createCanvas(), b = a && {
tag: "g",
attrs: {},
key: "dcl",
children: []
}, w = C(), T;
x && (x.width = w.width * t, x.height = w.height * t, T = x.getContext("2d")), D(), f && A1.put(p, x || b), u.image = x, u.svgElement = b, u.svgWidth = w.width, u.svgHeight = w.height;
function C() {
for (var M = 1, I = 0, L = _.length; I < L; ++I)
M = H0(M, _[I]);
for (var E = 1, I = 0, L = m.length; I < L; ++I)
E = H0(E, m[I].length);
M *= E;
var P = S * _.length * m.length;
if (process.env.NODE_ENV !== "production") {
var k = function(N) {
console.warn("Calculated decal size is greater than " + N + " due to decal option settings so " + N + " is used for the decal size. Please consider changing the decal option to make a smaller decal or set " + N + " to be larger to avoid incontinuity.");
};
M > o.maxTileWidth && k("maxTileWidth"), P > o.maxTileHeight && k("maxTileHeight");
}
return {
width: Math.max(1, Math.min(M, o.maxTileWidth)),
height: Math.max(1, Math.min(P, o.maxTileHeight))
};
}
function D() {
T && (T.clearRect(0, 0, x.width, x.height), o.backgroundColor && (T.fillStyle = o.backgroundColor, T.fillRect(0, 0, x.width, x.height)));
for (var M = 0, I = 0; I < y.length; ++I)
M += y[I];
if (M <= 0)
return;
for (var L = -S, E = 0, P = 0, k = 0; L < w.height; ) {
if (E % 2 === 0) {
for (var N = P / 2 % m.length, R = 0, V = 0, F = 0; R < w.width * 2; ) {
for (var H = 0, I = 0; I < g[k].length; ++I)
H += g[k][I];
if (H <= 0)
break;
if (V % 2 === 0) {
var $ = (1 - o.symbolSize) * 0.5, j = R + g[k][V] * $, Q = L + y[E] * $, st = g[k][V] * o.symbolSize, Et = y[E] * o.symbolSize, qt = F / 2 % m[N].length;
vt(j, Q, st, Et, m[N][qt]);
}
R += g[k][V], ++F, ++V, V === g[k].length && (V = 0);
}
++k, k === g.length && (k = 0);
}
L += y[E], ++P, ++E, E === y.length && (E = 0);
}
function vt(rt, dt, q, lt, Vt) {
var Lt = a ? 1 : t, Rt = ae(Vt, rt * Lt, dt * Lt, q * Lt, lt * Lt, o.color, o.symbolKeepAspect);
if (a) {
var Ut = n.painter.renderOneToVNode(Rt);
Ut && b.children.push(Ut);
} else
pA(T, Rt);
}
}
}
}
function dA(r) {
if (!r || r.length === 0)
return [["rect"]];
if (U(r))
return [[r]];
for (var e = !0, t = 0; t < r.length; ++t)
if (!U(r[t])) {
e = !1;
break;
}
if (e)
return dA([r]);
for (var n = [], t = 0; t < r.length; ++t)
U(r[t]) ? n.push([r[t]]) : n.push(r[t]);
return n;
}
function gA(r) {
if (!r || r.length === 0)
return [[0, 0]];
if (Tt(r)) {
var e = Math.ceil(r);
return [[e, e]];
}
for (var t = !0, n = 0; n < r.length; ++n)
if (!Tt(r[n])) {
t = !1;
break;
}
if (t)
return gA([r]);
for (var a = [], n = 0; n < r.length; ++n)
if (Tt(r[n])) {
var e = Math.ceil(r[n]);
a.push([e, e]);
} else {
var e = G(r[n], function(s) {
return Math.ceil(s);
});
e.length % 2 === 1 ? a.push(e.concat(e)) : a.push(e);
}
return a;
}
function GV(r) {
if (!r || typeof r == "object" && r.length === 0)
return [0, 0];
if (Tt(r)) {
var e = Math.ceil(r);
return [e, e];
}
var t = G(r, function(n) {
return Math.ceil(n);
});
return r.length % 2 ? t.concat(t) : t;
}
function FV(r) {
return G(r, function(e) {
return yA(e);
});
}
function yA(r) {
for (var e = 0, t = 0; t < r.length; ++t)
e += r[t];
return r.length % 2 === 1 ? e * 2 : e;
}
function HV(r, e) {
r.eachRawSeries(function(t) {
if (!r.isSeriesFiltered(t)) {
var n = t.getData();
n.hasItemVisual() && n.each(function(o) {
var s = n.getItemVisual(o, "decal");
if (s) {
var l = n.ensureUniqueItemVisual(o, "style");
l.decal = Mo(s, e);
}
});
var a = n.getVisual("decal");
if (a) {
var i = n.getVisual("style");
i.decal = Mo(a, e);
}
}
});
}
var Ar = new xr(), jh = {};
function WV(r, e) {
process.env.NODE_ENV !== "production" && jh[r] && _e("Already has an implementation of " + r + "."), jh[r] = e;
}
function $V(r) {
return process.env.NODE_ENV !== "production" && (jh[r] || _e("Implementation of " + r + " doesn't exists.")), jh[r];
}
var UV = 1, YV = 800, ZV = 900, XV = 1e3, qV = 2e3, KV = 5e3, mA = 1e3, jV = 1100, Gy = 2e3, _A = 3e3, QV = 4e3, ic = 4500, JV = 4600, tB = 5e3, eB = 6e3, SA = 7e3, rB = {
PROCESSOR: {
FILTER: XV,
SERIES_FILTER: YV,
STATISTIC: KV
},
VISUAL: {
LAYOUT: mA,
PROGRESSIVE_LAYOUT: jV,
GLOBAL: Gy,
CHART: _A,
POST_CHART_LAYOUT: JV,
COMPONENT: QV,
BRUSH: tB,
CHART_ITEM: ic,
ARIA: eB,
DECAL: SA
}
}, we = "__flagInMainProcess", Ue = "__pendingUpdate", gv = "__needsUpdateStatus", I1 = /^[a-zA-Z0-9_]+$/, yv = "__connectUpdateStatus", L1 = 0, nB = 1, aB = 2;
function xA(r) {
return function() {
for (var e = [], t = 0; t < arguments.length; t++)
e[t] = arguments[t];
if (this.isDisposed()) {
Qe(this.id);
return;
}
return wA(this, r, e);
};
}
function bA(r) {
return function() {
for (var e = [], t = 0; t < arguments.length; t++)
e[t] = arguments[t];
return wA(this, r, e);
};
}
function wA(r, e, t) {
return t[0] = t[0] && t[0].toLowerCase(), xr.prototype[e].apply(r, t);
}
var TA = (
/** @class */
function(r) {
O(e, r);
function e() {
return r !== null && r.apply(this, arguments) || this;
}
return e;
}(xr)
), CA = TA.prototype;
CA.on = bA("on");
CA.off = bA("off");
var qi, mv, Du, Hn, _v, Sv, xv, vs, ps, E1, P1, bv, k1, Au, R1, DA, ar, N1, AA = (
/** @class */
function(r) {
O(e, r);
function e(t, n, a) {
var i = r.call(this, new cV()) || this;
i._chartsViews = [], i._chartsMap = {}, i._componentsViews = [], i._componentsMap = {}, i._pendingActions = [], a = a || {}, U(n) && (n = MA[n]), i._dom = t;
var o = "canvas", s = "auto", l = !1;
if (process.env.NODE_ENV !== "production") {
var u = (
/* eslint-disable-next-line */
yt.hasGlobalWindow ? window : global
);
u && (o = ot(u.__ECHARTS__DEFAULT__RENDERER__, o), s = ot(u.__ECHARTS__DEFAULT__COARSE_POINTER, s), l = ot(u.__ECHARTS__DEFAULT__USE_DIRTY_RECT__, l));
}
a.ssr && XP(function(v) {
var p = it(v), d = p.dataIndex;
if (d != null) {
var g = X();
return g.set("series_index", p.seriesIndex), g.set("data_index", d), p.ssrType && g.set("ssr_type", p.ssrType), g;
}
});
var h = i._zr = z0(t, {
renderer: a.renderer || o,
devicePixelRatio: a.devicePixelRatio,
width: a.width,
height: a.height,
ssr: a.ssr,
useDirtyRect: ot(a.useDirtyRect, l),
useCoarsePointer: ot(a.useCoarsePointer, s),
pointerSize: a.pointerSize
});
i._ssr = a.ssr, i._throttledZrFlush = Vy(Y(h.flush, h), 17), n = nt(n), n && RD(n, !0), i._theme = n, i._locale = xN(a.locale || hD), i._coordSysMgr = new Yo();
var f = i._api = R1(i);
function c(v, p) {
return v.__prio - p.__prio;
}
return sh(Jh, c), sh(Ud, c), i._scheduler = new iA(i, f, Ud, Jh), i._messageCenter = new TA(), i._initEvents(), i.resize = Y(i.resize, i), h.animation.on("frame", i._onframe, i), E1(h, i), P1(h, i), Ih(i), i;
}
return e.prototype._onframe = function() {
if (!this._disposed) {
N1(this);
var t = this._scheduler;
if (this[Ue]) {
var n = this[Ue].silent;
this[we] = !0;
try {
qi(this), Hn.update.call(this, null, this[Ue].updateParams);
} catch (l) {
throw this[we] = !1, this[Ue] = null, l;
}
this._zr.flush(), this[we] = !1, this[Ue] = null, vs.call(this, n), ps.call(this, n);
} else if (t.unfinished) {
var a = UV, i = this._model, o = this._api;
t.unfinished = !1;
do {
var s = +/* @__PURE__ */ new Date();
t.performSeriesTasks(i), t.performDataProcessorTasks(i), Sv(this, i), t.performVisualTasks(i), Au(this, this._model, o, "remain", {}), a -= +/* @__PURE__ */ new Date() - s;
} while (a > 0 && t.unfinished);
t.unfinished || this._zr.flush();
}
}
}, e.prototype.getDom = function() {
return this._dom;
}, e.prototype.getId = function() {
return this.id;
}, e.prototype.getZr = function() {
return this._zr;
}, e.prototype.isSSR = function() {
return this._ssr;
}, e.prototype.setOption = function(t, n, a) {
if (this[we]) {
process.env.NODE_ENV !== "production" && _e("`setOption` should not be called during main process.");
return;
}
if (this._disposed) {
Qe(this.id);
return;
}
var i, o, s;
if (J(n) && (a = n.lazyUpdate, i = n.silent, o = n.replaceMerge, s = n.transition, n = n.notMerge), this[we] = !0, !this._model || n) {
var l = new XN(this._api), u = this._theme, h = this._model = new Py();
h.scheduler = this._scheduler, h.ssr = this._ssr, h.init(null, null, null, u, this._locale, l);
}
this._model.setOption(t, {
replaceMerge: o
}, Yd);
var f = {
seriesTransition: s,
optionChanged: !0
};
if (a)
this[Ue] = {
silent: i,
updateParams: f
}, this[we] = !1, this.getZr().wakeUp();
else {
try {
qi(this), Hn.update.call(this, null, f);
} catch (c) {
throw this[Ue] = null, this[we] = !1, c;
}
this._ssr || this._zr.flush(), this[Ue] = null, this[we] = !1, vs.call(this, i), ps.call(this, i);
}
}, e.prototype.setTheme = function() {
Nr("ECharts#setTheme() is DEPRECATED in ECharts 3.0");
}, e.prototype.getModel = function() {
return this._model;
}, e.prototype.getOption = function() {
return this._model && this._model.getOption();
}, e.prototype.getWidth = function() {
return this._zr.getWidth();
}, e.prototype.getHeight = function() {
return this._zr.getHeight();
}, e.prototype.getDevicePixelRatio = function() {
return this._zr.painter.dpr || yt.hasGlobalWindow && window.devicePixelRatio || 1;
}, e.prototype.getRenderedCanvas = function(t) {
return process.env.NODE_ENV !== "production" && ee("getRenderedCanvas", "renderToCanvas"), this.renderToCanvas(t);
}, e.prototype.renderToCanvas = function(t) {
t = t || {};
var n = this._zr.painter;
if (process.env.NODE_ENV !== "production" && n.type !== "canvas")
throw new Error("renderToCanvas can only be used in the canvas renderer.");
return n.getRenderedCanvas({
backgroundColor: t.backgroundColor || this._model.get("backgroundColor"),
pixelRatio: t.pixelRatio || this.getDevicePixelRatio()
});
}, e.prototype.renderToSVGString = function(t) {
t = t || {};
var n = this._zr.painter;
if (process.env.NODE_ENV !== "production" && n.type !== "svg")
throw new Error("renderToSVGString can only be used in the svg renderer.");
return n.renderToString({
useViewBox: t.useViewBox
});
}, e.prototype.getSvgDataURL = function() {
if (yt.svgSupported) {
var t = this._zr, n = t.storage.getDisplayList();
return A(n, function(a) {
a.stopAnimation(null, !0);
}), t.painter.toDataURL();
}
}, e.prototype.getDataURL = function(t) {
if (this._disposed) {
Qe(this.id);
return;
}
t = t || {};
var n = t.excludeComponents, a = this._model, i = [], o = this;
A(n, function(l) {
a.eachComponent({
mainType: l
}, function(u) {
var h = o._componentsMap[u.__viewId];
h.group.ignore || (i.push(h), h.group.ignore = !0);
});
});
var s = this._zr.painter.getType() === "svg" ? this.getSvgDataURL() : this.renderToCanvas(t).toDataURL("image/" + (t && t.type || "png"));
return A(i, function(l) {
l.group.ignore = !1;
}), s;
}, e.prototype.getConnectedDataURL = function(t) {
if (this._disposed) {
Qe(this.id);
return;
}
var n = t.type === "svg", a = this.group, i = Math.min, o = Math.max, s = 1 / 0;
if (O1[a]) {
var l = s, u = s, h = -s, f = -s, c = [], v = t && t.pixelRatio || this.getDevicePixelRatio();
A(rl, function(_, S) {
if (_.group === a) {
var x = n ? _.getZr().painter.getSvgDom().innerHTML : _.renderToCanvas(nt(t)), b = _.getDom().getBoundingClientRect();
l = i(b.left, l), u = i(b.top, u), h = o(b.right, h), f = o(b.bottom, f), c.push({
dom: x,
left: b.left,
top: b.top
});
}
}), l *= v, u *= v, h *= v, f *= v;
var p = h - l, d = f - u, g = ha.createCanvas(), y = z0(g, {
renderer: n ? "svg" : "canvas"
});
if (y.resize({
width: p,
height: d
}), n) {
var m = "";
return A(c, function(_) {
var S = _.left - l, x = _.top - u;
m += '<g transform="translate(' + S + "," + x + ')">' + _.dom + "</g>";
}), y.painter.getSvgRoot().innerHTML = m, t.connectedBackgroundColor && y.painter.setBackgroundColor(t.connectedBackgroundColor), y.refreshImmediately(), y.painter.toDataURL();
} else
return t.connectedBackgroundColor && y.add(new xt({
shape: {
x: 0,
y: 0,
width: p,
height: d
},
style: {
fill: t.connectedBackgroundColor
}
})), A(c, function(_) {
var S = new ge({
style: {
x: _.left * v - l,
y: _.top * v - u,
image: _.dom
}
});
y.add(S);
}), y.refreshImmediately(), g.toDataURL("image/" + (t && t.type || "png"));
} else
return this.getDataURL(t);
}, e.prototype.convertToPixel = function(t, n) {
return _v(this, "convertToPixel", t, n);
}, e.prototype.convertFromPixel = function(t, n) {
return _v(this, "convertFromPixel", t, n);
}, e.prototype.containPixel = function(t, n) {
if (this._disposed) {
Qe(this.id);
return;
}
var a = this._model, i, o = qs(a, t);
return A(o, function(s, l) {
l.indexOf("Models") >= 0 && A(s, function(u) {
var h = u.coordinateSystem;
if (h && h.containPoint)
i = i || !!h.containPoint(n);
else if (l === "seriesModels") {
var f = this._chartsMap[u.__viewId];
f && f.containPoint ? i = i || f.containPoint(n, u) : process.env.NODE_ENV !== "production" && Zt(l + ": " + (f ? "The found component do not support containPoint." : "No view mapping to the found component."));
} else
process.env.NODE_ENV !== "production" && Zt(l + ": containPoint is not supported");
}, this);
}, this), !!i;
}, e.prototype.getVisual = function(t, n) {
var a = this._model, i = qs(a, t, {
defaultMainType: "series"
}), o = i.seriesModel;
process.env.NODE_ENV !== "production" && (o || Zt("There is no specified series model"));
var s = o.getData(), l = i.hasOwnProperty("dataIndexInside") ? i.dataIndexInside : i.hasOwnProperty("dataIndex") ? s.indexOfRawIndex(i.dataIndex) : null;
return l != null ? By(s, l, n) : Wl(s, n);
}, e.prototype.getViewOfComponentModel = function(t) {
return this._componentsMap[t.__viewId];
}, e.prototype.getViewOfSeriesModel = function(t) {
return this._chartsMap[t.__viewId];
}, e.prototype._initEvents = function() {
var t = this;
A(iB, function(n) {
var a = function(i) {
var o = t.getModel(), s = i.target, l, u = n === "globalout";
if (u ? l = {} : s && ii(s, function(p) {
var d = it(p);
if (d && d.dataIndex != null) {
var g = d.dataModel || o.getSeriesByIndex(d.seriesIndex);
return l = g && g.getDataParams(d.dataIndex, d.dataType, s) || {}, !0;
} else if (d.eventData)
return l = B({}, d.eventData), !0;
}, !0), l) {
var h = l.componentType, f = l.componentIndex;
(h === "markLine" || h === "markPoint" || h === "markArea") && (h = "series", f = l.seriesIndex);
var c = h && f != null && o.getComponent(h, f), v = c && t[c.mainType === "series" ? "_chartsMap" : "_componentsMap"][c.__viewId];
process.env.NODE_ENV !== "production" && !u && !(c && v) && Zt("model or view can not be found by params"), l.event = i, l.type = n, t._$eventProcessor.eventInfo = {
targetEl: s,
packedEvent: l,
model: c,
view: v
}, t.trigger(n, l);
}
};
a.zrEventfulCallAtLast = !0, t._zr.on(n, a, t);
}), A(el, function(n, a) {
t._messageCenter.on(a, function(i) {
this.trigger(a, i);
}, t);
}), A(["selectchanged"], function(n) {
t._messageCenter.on(n, function(a) {
this.trigger(n, a);
}, t);
}), dV(this._messageCenter, this, this._api);
}, e.prototype.isDisposed = function() {
return this._disposed;
}, e.prototype.clear = function() {
if (this._disposed) {
Qe(this.id);
return;
}
this.setOption({
series: []
}, !0);
}, e.prototype.dispose = function() {
if (this._disposed) {
Qe(this.id);
return;
}
this._disposed = !0;
var t = this.getDom();
t && bC(this.getDom(), Hy, "");
var n = this, a = n._api, i = n._model;
A(n._componentsViews, function(o) {
o.dispose(i, a);
}), A(n._chartsViews, function(o) {
o.dispose(i, a);
}), n._zr.dispose(), n._dom = n._model = n._chartsMap = n._componentsMap = n._chartsViews = n._componentsViews = n._scheduler = n._api = n._zr = n._throttledZrFlush = n._theme = n._coordSysMgr = n._messageCenter = null, delete rl[n.id];
}, e.prototype.resize = function(t) {
if (this[we]) {
process.env.NODE_ENV !== "production" && _e("`resize` should not be called during main process.");
return;
}
if (this._disposed) {
Qe(this.id);
return;
}
this._zr.resize(t);
var n = this._model;
if (this._loadingFX && this._loadingFX.resize(), !!n) {
var a = n.resetOption("media"), i = t && t.silent;
this[Ue] && (i == null && (i = this[Ue].silent), a = !0, this[Ue] = null), this[we] = !0;
try {
a && qi(this), Hn.update.call(this, {
type: "resize",
animation: B({
// Disable animation
duration: 0
}, t && t.animation)
});
} catch (o) {
throw this[we] = !1, o;
}
this[we] = !1, vs.call(this, i), ps.call(this, i);
}
}, e.prototype.showLoading = function(t, n) {
if (this._disposed) {
Qe(this.id);
return;
}
if (J(t) && (n = t, t = ""), t = t || "default", this.hideLoading(), !Zd[t]) {
process.env.NODE_ENV !== "production" && Zt("Loading effects " + t + " not exists.");
return;
}
var a = Zd[t](this._api, n), i = this._zr;
this._loadingFX = a, i.add(a);
}, e.prototype.hideLoading = function() {
if (this._disposed) {
Qe(this.id);
return;
}
this._loadingFX && this._zr.remove(this._loadingFX), this._loadingFX = null;
}, e.prototype.makeActionFromEvent = function(t) {
var n = B({}, t);
return n.type = el[t.type], n;
}, e.prototype.dispatchAction = function(t, n) {
if (this._disposed) {
Qe(this.id);
return;
}
if (J(n) || (n = {
silent: !!n
}), !!Qh[t.type] && this._model) {
if (this[we]) {
this._pendingActions.push(t);
return;
}
var a = n.silent;
xv.call(this, t, a);
var i = n.flush;
i ? this._zr.flush() : i !== !1 && yt.browser.weChat && this._throttledZrFlush(), vs.call(this, a), ps.call(this, a);
}
}, e.prototype.updateLabelLayout = function() {
Ar.trigger("series:layoutlabels", this._model, this._api, {
// Not adding series labels.
// TODO
updatedSeries: []
});
}, e.prototype.appendData = function(t) {
if (this._disposed) {
Qe(this.id);
return;
}
var n = t.seriesIndex, a = this.getModel(), i = a.getSeriesByIndex(n);
process.env.NODE_ENV !== "production" && tt(t.data && i), i.appendData(t), this._scheduler.unfinished = !0, this.getZr().wakeUp();
}, e.internalField = function() {
qi = function(f) {
var c = f._scheduler;
c.restorePipelines(f._model), c.prepareStageTasks(), mv(f, !0), mv(f, !1), c.plan();
}, mv = function(f, c) {
for (var v = f._model, p = f._scheduler, d = c ? f._componentsViews : f._chartsViews, g = c ? f._componentsMap : f._chartsMap, y = f._zr, m = f._api, _ = 0; _ < d.length; _++)
d[_].__alive = !1;
c ? v.eachComponent(function(b, w) {
b !== "series" && S(w);
}) : v.eachSeries(S);
function S(b) {
var w = b.__requireNewView;
b.__requireNewView = !1;
var T = "_ec_" + b.id + "_" + b.type, C = !w && g[T];
if (!C) {
var D = jr(b.type), M = c ? Yt.getClass(D.main, D.sub) : (
// FIXME:TS
// (ChartView as ChartViewConstructor).getClass('series', classType.sub)
// For backward compat, still support a chart type declared as only subType
// like "liquidfill", but recommend "series.liquidfill"
// But need a base class to make a type series.
kt.getClass(D.sub)
);
process.env.NODE_ENV !== "production" && tt(M, D.sub + " does not exist."), C = new M(), C.init(v, m), g[T] = C, d.push(C), y.add(C.group);
}
b.__viewId = C.__id = T, C.__alive = !0, C.__model = b, C.group.__ecComponentInfo = {
mainType: b.mainType,
index: b.componentIndex
}, !c && p.prepareView(C, b, v, m);
}
for (var _ = 0; _ < d.length; ) {
var x = d[_];
x.__alive ? _++ : (!c && x.renderTask.dispose(), y.remove(x.group), x.dispose(v, m), d.splice(_, 1), g[x.__id] === x && delete g[x.__id], x.__id = x.group.__ecComponentInfo = null);
}
}, Du = function(f, c, v, p, d) {
var g = f._model;
if (g.setUpdatePayload(v), !p) {
A([].concat(f._componentsViews).concat(f._chartsViews), x);
return;
}
var y = {};
y[p + "Id"] = v[p + "Id"], y[p + "Index"] = v[p + "Index"], y[p + "Name"] = v[p + "Name"];
var m = {
mainType: p,
query: y
};
d && (m.subType = d);
var _ = v.excludeSeriesId, S;
_ != null && (S = X(), A(Pt(_), function(b) {
var w = oe(b, null);
w != null && S.set(w, !0);
})), g && g.eachComponent(m, function(b) {
var w = S && S.get(b.id) != null;
if (!w)
if (y_(v))
if (b instanceof Ft)
v.type === ci && !v.notBlur && !b.get(["emphasis", "disabled"]) && SR(b, v, f._api);
else {
var T = yy(b.mainType, b.componentIndex, v.name, f._api), C = T.focusSelf, D = T.dispatchers;
v.type === ci && C && !v.notBlur && Dd(b.mainType, b.componentIndex, f._api), D && A(D, function(M) {
v.type === ci ? Mn(M) : In(M);
});
}
else Md(v) && b instanceof Ft && (wR(b, v, f._api), d_(b), ar(f));
}, f), g && g.eachComponent(m, function(b) {
var w = S && S.get(b.id) != null;
w || x(f[p === "series" ? "_chartsMap" : "_componentsMap"][b.__viewId]);
}, f);
function x(b) {
b && b.__alive && b[c] && b[c](b.__model, g, f._api, v);
}
}, Hn = {
prepareAndUpdate: function(f) {
qi(this), Hn.update.call(this, f, {
// Needs to mark option changed if newOption is given.
// It's from MagicType.
// TODO If use a separate flag optionChanged in payload?
optionChanged: f.newOption != null
});
},
update: function(f, c) {
var v = this._model, p = this._api, d = this._zr, g = this._coordSysMgr, y = this._scheduler;
if (v) {
v.setUpdatePayload(f), y.restoreData(v, f), y.performSeriesTasks(v), g.create(v, p), y.performDataProcessorTasks(v, f), Sv(this, v), g.update(v, p), t(v), y.performVisualTasks(v, f), bv(this, v, p, f, c);
var m = v.get("backgroundColor") || "transparent", _ = v.get("darkMode");
d.setBackgroundColor(m), _ != null && _ !== "auto" && d.setDarkMode(_), Ar.trigger("afterupdate", v, p);
}
},
updateTransform: function(f) {
var c = this, v = this._model, p = this._api;
if (v) {
v.setUpdatePayload(f);
var d = [];
v.eachComponent(function(y, m) {
if (y !== "series") {
var _ = c.getViewOfComponentModel(m);
if (_ && _.__alive)
if (_.updateTransform) {
var S = _.updateTransform(m, v, p, f);
S && S.update && d.push(_);
} else
d.push(_);
}
});
var g = X();
v.eachSeries(function(y) {
var m = c._chartsMap[y.__viewId];
if (m.updateTransform) {
var _ = m.updateTransform(y, v, p, f);
_ && _.update && g.set(y.uid, 1);
} else
g.set(y.uid, 1);
}), t(v), this._scheduler.performVisualTasks(v, f, {
setDirty: !0,
dirtyMap: g
}), Au(this, v, p, f, {}, g), Ar.trigger("afterupdate", v, p);
}
},
updateView: function(f) {
var c = this._model;
c && (c.setUpdatePayload(f), kt.markUpdateMethod(f, "updateView"), t(c), this._scheduler.performVisualTasks(c, f, {
setDirty: !0
}), bv(this, c, this._api, f, {}), Ar.trigger("afterupdate", c, this._api));
},
updateVisual: function(f) {
var c = this, v = this._model;
v && (v.setUpdatePayload(f), v.eachSeries(function(p) {
p.getData().clearAllVisual();
}), kt.markUpdateMethod(f, "updateVisual"), t(v), this._scheduler.performVisualTasks(v, f, {
visualType: "visual",
setDirty: !0
}), v.eachComponent(function(p, d) {
if (p !== "series") {
var g = c.getViewOfComponentModel(d);
g && g.__alive && g.updateVisual(d, v, c._api, f);
}
}), v.eachSeries(function(p) {
var d = c._chartsMap[p.__viewId];
d.updateVisual(p, v, c._api, f);
}), Ar.trigger("afterupdate", v, this._api));
},
updateLayout: function(f) {
Hn.update.call(this, f);
}
}, _v = function(f, c, v, p) {
if (f._disposed) {
Qe(f.id);
return;
}
for (var d = f._model, g = f._coordSysMgr.getCoordinateSystems(), y, m = qs(d, v), _ = 0; _ < g.length; _++) {
var S = g[_];
if (S[c] && (y = S[c](d, m, p)) != null)
return y;
}
process.env.NODE_ENV !== "production" && Zt("No coordinate system that supports " + c + " found by the given finder.");
}, Sv = function(f, c) {
var v = f._chartsMap, p = f._scheduler;
c.eachSeries(function(d) {
p.updateStreamModes(d, v[d.__viewId]);
});
}, xv = function(f, c) {
var v = this, p = this.getModel(), d = f.type, g = f.escapeConnect, y = Qh[d], m = y.actionInfo, _ = (m.update || "update").split(":"), S = _.pop(), x = _[0] != null && jr(_[0]);
this[we] = !0;
var b = [f], w = !1;
f.batch && (w = !0, b = G(f.batch, function(E) {
return E = et(B({}, E), f), E.batch = null, E;
}));
var T = [], C, D = Md(f), M = y_(f);
if (M && WC(this._api), A(b, function(E) {
if (C = y.action(E, v._model, v._api), C = C || B({}, E), C.type = m.event || C.type, T.push(C), M) {
var P = uy(f), k = P.queryOptionMap, N = P.mainTypeSpecified, R = N ? k.keys()[0] : "series";
Du(v, S, E, R), ar(v);
} else D ? (Du(v, S, E, "series"), ar(v)) : x && Du(v, S, E, x.main, x.sub);
}), S !== "none" && !M && !D && !x)
try {
this[Ue] ? (qi(this), Hn.update.call(this, f), this[Ue] = null) : Hn[S].call(this, f);
} catch (E) {
throw this[we] = !1, E;
}
if (w ? C = {
type: m.event || d,
escapeConnect: g,
batch: T
} : C = T[0], this[we] = !1, !c) {
var I = this._messageCenter;
if (I.trigger(C.type, C), D) {
var L = {
type: "selectchanged",
escapeConnect: g,
selected: TR(p),
isFromClick: f.isFromClick || !1,
fromAction: f.type,
fromActionPayload: f
};
I.trigger(L.type, L);
}
}
}, vs = function(f) {
for (var c = this._pendingActions; c.length; ) {
var v = c.shift();
xv.call(this, v, f);
}
}, ps = function(f) {
!f && this.trigger("updated");
}, E1 = function(f, c) {
f.on("rendered", function(v) {
c.trigger("rendered", v), // Although zr is dirty if initial animation is not finished
// and this checking is called on frame, we also check
// animation finished for robustness.
f.animation.isFinished() && !c[Ue] && !c._scheduler.unfinished && !c._pendingActions.length && c.trigger("finished");
});
}, P1 = function(f, c) {
f.on("mouseover", function(v) {
var p = v.target, d = ii(p, ca);
d && (xR(d, v, c._api), ar(c));
}).on("mouseout", function(v) {
var p = v.target, d = ii(p, ca);
d && (bR(d, v, c._api), ar(c));
}).on("click", function(v) {
var p = v.target, d = ii(p, function(m) {
return it(m).dataIndex != null;
}, !0);
if (d) {
var g = d.selected ? "unselect" : "select", y = it(d);
c._api.dispatchAction({
type: g,
dataType: y.dataType,
dataIndexInside: y.dataIndex,
seriesIndex: y.seriesIndex,
isFromClick: !0
});
}
});
};
function t(f) {
f.clearColorPalette(), f.eachSeries(function(c) {
c.clearColorPalette();
});
}
function n(f) {
var c = [], v = [], p = !1;
if (f.eachComponent(function(m, _) {
var S = _.get("zlevel") || 0, x = _.get("z") || 0, b = _.getZLevelKey();
p = p || !!b, (m === "series" ? v : c).push({
zlevel: S,
z: x,
idx: _.componentIndex,
type: m,
key: b
});
}), p) {
var d = c.concat(v), g, y;
sh(d, function(m, _) {
return m.zlevel === _.zlevel ? m.z - _.z : m.zlevel - _.zlevel;
}), A(d, function(m) {
var _ = f.getComponent(m.type, m.idx), S = m.zlevel, x = m.key;
g != null && (S = Math.max(g, S)), x ? (S === g && x !== y && S++, y = x) : y && (S === g && S++, y = ""), g = S, _.setZLevel(S);
});
}
}
bv = function(f, c, v, p, d) {
n(c), k1(f, c, v, p, d), A(f._chartsViews, function(g) {
g.__alive = !1;
}), Au(f, c, v, p, d), A(f._chartsViews, function(g) {
g.__alive || g.remove(c, v);
});
}, k1 = function(f, c, v, p, d, g) {
A(g || f._componentsViews, function(y) {
var m = y.__model;
u(m, y), y.render(m, c, v, p), s(m, y), h(m, y);
});
}, Au = function(f, c, v, p, d, g) {
var y = f._scheduler;
d = B(d || {}, {
updatedSeries: c.getSeries()
}), Ar.trigger("series:beforeupdate", c, v, d);
var m = !1;
c.eachSeries(function(_) {
var S = f._chartsMap[_.__viewId];
S.__alive = !0;
var x = S.renderTask;
y.updatePayload(x, p), u(_, S), g && g.get(_.uid) && x.dirty(), x.perform(y.getPerformArgs(x)) && (m = !0), S.group.silent = !!_.get("silent"), o(_, S), d_(_);
}), y.unfinished = m || y.unfinished, Ar.trigger("series:layoutlabels", c, v, d), Ar.trigger("series:transition", c, v, d), c.eachSeries(function(_) {
var S = f._chartsMap[_.__viewId];
s(_, S), h(_, S);
}), i(f, c), Ar.trigger("series:afterupdate", c, v, d);
}, ar = function(f) {
f[gv] = !0, f.getZr().wakeUp();
}, N1 = function(f) {
f[gv] && (f.getZr().storage.traverse(function(c) {
_o(c) || a(c);
}), f[gv] = !1);
};
function a(f) {
for (var c = [], v = f.currentStates, p = 0; p < v.length; p++) {
var d = v[p];
d === "emphasis" || d === "blur" || d === "select" || c.push(d);
}
f.selected && f.states.select && c.push("select"), f.hoverState === Wf && f.states.emphasis ? c.push("emphasis") : f.hoverState === Vl && f.states.blur && c.push("blur"), f.useStates(c);
}
function i(f, c) {
var v = f._zr, p = v.storage, d = 0;
p.traverse(function(g) {
g.isGroup || d++;
}), d > c.get("hoverLayerThreshold") && !yt.node && !yt.worker && c.eachSeries(function(g) {
if (!g.preventUsingHoverLayer) {
var y = f._chartsMap[g.__viewId];
y.__alive && y.eachRendered(function(m) {
m.states.emphasis && (m.states.emphasis.hoverLayer = !0);
});
}
});
}
function o(f, c) {
var v = f.get("blendMode") || null;
c.eachRendered(function(p) {
p.isGroup || (p.style.blend = v);
});
}
function s(f, c) {
if (!f.preventAutoZ) {
var v = f.get("z") || 0, p = f.get("zlevel") || 0;
c.eachRendered(function(d) {
return l(d, v, p, -1 / 0), !0;
});
}
}
function l(f, c, v, p) {
var d = f.getTextContent(), g = f.getTextGuideLine(), y = f.isGroup;
if (y)
for (var m = f.childrenRef(), _ = 0; _ < m.length; _++)
p = Math.max(l(m[_], c, v, p), p);
else
f.z = c, f.zlevel = v, p = Math.max(f.z2, p);
if (d && (d.z = c, d.zlevel = v, isFinite(p) && (d.z2 = p + 2)), g) {
var S = f.textGuideLineConfig;
g.z = c, g.zlevel = v, isFinite(p) && (g.z2 = p + (S && S.showAbove ? 1 : -1));
}
return p;
}
function u(f, c) {
c.eachRendered(function(v) {
if (!_o(v)) {
var p = v.getTextContent(), d = v.getTextGuideLine();
v.stateTransition && (v.stateTransition = null), p && p.stateTransition && (p.stateTransition = null), d && d.stateTransition && (d.stateTransition = null), v.hasState() ? (v.prevStates = v.currentStates, v.clearStates()) : v.prevStates && (v.prevStates = null);
}
});
}
function h(f, c) {
var v = f.getModel("stateAnimation"), p = f.isAnimationEnabled(), d = v.get("duration"), g = d > 0 ? {
duration: d,
delay: v.get("delay"),
easing: v.get("easing")
// additive: stateAnimationModel.get('additive')
} : null;
c.eachRendered(function(y) {
if (y.states && y.states.emphasis) {
if (_o(y))
return;
if (y instanceof mt && IR(y), y.__dirty) {
var m = y.prevStates;
m && y.useStates(m);
}
if (p) {
y.stateTransition = g;
var _ = y.getTextContent(), S = y.getTextGuideLine();
_ && (_.stateTransition = g), S && (S.stateTransition = g);
}
y.__dirty && a(y);
}
});
}
R1 = function(f) {
return new /** @class */
(function(c) {
O(v, c);
function v() {
return c !== null && c.apply(this, arguments) || this;
}
return v.prototype.getCoordinateSystems = function() {
return f._coordSysMgr.getCoordinateSystems();
}, v.prototype.getComponentByElement = function(p) {
for (; p; ) {
var d = p.__ecComponentInfo;
if (d != null)
return f._model.getComponent(d.mainType, d.index);
p = p.parent;
}
}, v.prototype.enterEmphasis = function(p, d) {
Mn(p, d), ar(f);
}, v.prototype.leaveEmphasis = function(p, d) {
In(p, d), ar(f);
}, v.prototype.enterBlur = function(p) {
zC(p), ar(f);
}, v.prototype.leaveBlur = function(p) {
gy(p), ar(f);
}, v.prototype.enterSelect = function(p) {
GC(p), ar(f);
}, v.prototype.leaveSelect = function(p) {
FC(p), ar(f);
}, v.prototype.getModel = function() {
return f.getModel();
}, v.prototype.getViewOfComponentModel = function(p) {
return f.getViewOfComponentModel(p);
}, v.prototype.getViewOfSeriesModel = function(p) {
return f.getViewOfSeriesModel(p);
}, v;
}(PD))(f);
}, DA = function(f) {
function c(v, p) {
for (var d = 0; d < v.length; d++) {
var g = v[d];
g[yv] = p;
}
}
A(el, function(v, p) {
f._messageCenter.on(p, function(d) {
if (O1[f.group] && f[yv] !== L1) {
if (d && d.escapeConnect)
return;
var g = f.makeActionFromEvent(d), y = [];
A(rl, function(m) {
m !== f && m.group === f.group && y.push(m);
}), c(y, L1), A(y, function(m) {
m[yv] !== nB && m.dispatchAction(g);
}), c(y, aB);
}
});
});
};
}(), e;
}(xr)
), Fy = AA.prototype;
Fy.on = xA("on");
Fy.off = xA("off");
Fy.one = function(r, e, t) {
var n = this;
Nr("ECharts#one is deprecated.");
function a() {
for (var i = [], o = 0; o < arguments.length; o++)
i[o] = arguments[o];
e && e.apply && e.apply(this, i), n.off(r, a);
}
this.on.call(this, r, a, t);
};
var iB = ["click", "dblclick", "mouseover", "mouseout", "mousemove", "mousedown", "mouseup", "globalout", "contextmenu"];
function Qe(r) {
process.env.NODE_ENV !== "production" && Zt("Instance " + r + " has been disposed");
}
var Qh = {}, el = {}, Ud = [], Yd = [], Jh = [], MA = {}, Zd = {}, rl = {}, O1 = {}, oB = +/* @__PURE__ */ new Date() - 0, Hy = "_echarts_instance_";
function sB(r, e, t) {
{
if (process.env.NODE_ENV !== "production" && !r)
throw new Error("Initialize failed: invalid dom.");
var n = lB(r);
if (n)
return process.env.NODE_ENV !== "production" && Zt("There is a chart instance already initialized on the dom."), n;
process.env.NODE_ENV !== "production" && _i(r) && r.nodeName.toUpperCase() !== "CANVAS" && (!r.clientWidth || !r.clientHeight) && Zt("Can't get DOM width or height. Please check dom.clientWidth and dom.clientHeight. They should not be 0.For example, you may need to call this in the callback of window.onload.");
}
var a = new AA(r, e, t);
return a.id = "ec_" + oB++, rl[a.id] = a, bC(r, Hy, a.id), DA(a), Ar.trigger("afterinit", a), a;
}
function lB(r) {
return rl[yk(r, Hy)];
}
function IA(r, e) {
MA[r] = e;
}
function LA(r) {
pt(Yd, r) < 0 && Yd.push(r);
}
function EA(r, e) {
$y(Ud, r, e, qV);
}
function uB(r) {
Wy("afterinit", r);
}
function hB(r) {
Wy("afterupdate", r);
}
function Wy(r, e) {
Ar.on(r, e);
}
function un(r, e, t) {
K(e) && (t = e, e = "");
var n = J(r) ? r.type : [r, r = {
event: e
}][0];
r.event = (r.event || n).toLowerCase(), e = r.event, !el[e] && (tt(I1.test(n) && I1.test(e)), Qh[n] || (Qh[n] = {
action: t,
actionInfo: r
}), el[e] = n);
}
function fB(r, e) {
Yo.register(r, e);
}
function cB(r, e) {
$y(Jh, r, e, mA, "layout");
}
function Ri(r, e) {
$y(Jh, r, e, _A, "visual");
}
var V1 = [];
function $y(r, e, t, n, a) {
if ((K(e) || J(e)) && (t = e, e = n), process.env.NODE_ENV !== "production") {
if (isNaN(e) || e == null)
throw new Error("Illegal priority");
A(r, function(o) {
tt(o.__raw !== t);
});
}
if (!(pt(V1, t) >= 0)) {
V1.push(t);
var i = iA.wrapStageHandler(t, a);
i.__prio = e, i.__raw = t, r.push(i);
}
}
function PA(r, e) {
Zd[r] = e;
}
function vB(r, e, t) {
var n = $V("registerMap");
n && n(r, e, t);
}
var pB = DO;
Ri(Gy, QO);
Ri(ic, JO);
Ri(ic, tV);
Ri(Gy, vV);
Ri(ic, pV);
Ri(SA, HV);
LA(RD);
EA(ZV, oO);
PA("default", eV);
un({
type: ci,
event: ci,
update: ci
}, Jt);
un({
type: ch,
event: ch,
update: ch
}, Jt);
un({
type: Ks,
event: Ks,
update: Ks
}, Jt);
un({
type: vh,
event: vh,
update: vh
}, Jt);
un({
type: js,
event: js,
update: js
}, Jt);
IA("light", fV);
IA("dark", uA);
var B1 = [], dB = {
registerPreprocessor: LA,
registerProcessor: EA,
registerPostInit: uB,
registerPostUpdate: hB,
registerUpdateLifecycle: Wy,
registerAction: un,
registerCoordinateSystem: fB,
registerLayout: cB,
registerVisual: Ri,
registerTransform: pB,
registerLoading: PA,
registerMap: vB,
registerImpl: WV,
PRIORITY: rB,
ComponentModel: _t,
ComponentView: Yt,
SeriesModel: Ft,
ChartView: kt,
// TODO Use ComponentModel and SeriesModel instead of Constructor
registerComponentModel: function(r) {
_t.registerClass(r);
},
registerComponentView: function(r) {
Yt.registerClass(r);
},
registerSeriesModel: function(r) {
Ft.registerClass(r);
},
registerChartView: function(r) {
kt.registerClass(r);
},
registerSubTypeDefaulter: function(r, e) {
_t.registerSubTypeDefaulter(r, e);
},
registerPainter: function(r, e) {
YP(r, e);
}
};
function gt(r) {
if (z(r)) {
A(r, function(e) {
gt(e);
});
return;
}
pt(B1, r) >= 0 || (B1.push(r), K(r) && (r = {
install: r
}), r.install(dB));
}
function ds(r) {
return r == null ? 0 : r.length || 1;
}
function z1(r) {
return r;
}
var Ln = (
/** @class */
function() {
function r(e, t, n, a, i, o) {
this._old = e, this._new = t, this._oldKeyGetter = n || z1, this._newKeyGetter = a || z1, this.context = i, this._diffModeMultiple = o === "multiple";
}
return r.prototype.add = function(e) {
return this._add = e, this;
}, r.prototype.update = function(e) {
return this._update = e, this;
}, r.prototype.updateManyToOne = function(e) {
return this._updateManyToOne = e, this;
}, r.prototype.updateOneToMany = function(e) {
return this._updateOneToMany = e, this;
}, r.prototype.updateManyToMany = function(e) {
return this._updateManyToMany = e, this;
}, r.prototype.remove = function(e) {
return this._remove = e, this;
}, r.prototype.execute = function() {
this[this._diffModeMultiple ? "_executeMultiple" : "_executeOneToOne"]();
}, r.prototype._executeOneToOne = function() {
var e = this._old, t = this._new, n = {}, a = new Array(e.length), i = new Array(t.length);
this._initIndexMap(e, null, a, "_oldKeyGetter"), this._initIndexMap(t, n, i, "_newKeyGetter");
for (var o = 0; o < e.length; o++) {
var s = a[o], l = n[s], u = ds(l);
if (u > 1) {
var h = l.shift();
l.length === 1 && (n[s] = l[0]), this._update && this._update(h, o);
} else u === 1 ? (n[s] = null, this._update && this._update(l, o)) : this._remove && this._remove(o);
}
this._performRestAdd(i, n);
}, r.prototype._executeMultiple = function() {
var e = this._old, t = this._new, n = {}, a = {}, i = [], o = [];
this._initIndexMap(e, n, i, "_oldKeyGetter"), this._initIndexMap(t, a, o, "_newKeyGetter");
for (var s = 0; s < i.length; s++) {
var l = i[s], u = n[l], h = a[l], f = ds(u), c = ds(h);
if (f > 1 && c === 1)
this._updateManyToOne && this._updateManyToOne(h, u), a[l] = null;
else if (f === 1 && c > 1)
this._updateOneToMany && this._updateOneToMany(h, u), a[l] = null;
else if (f === 1 && c === 1)
this._update && this._update(h, u), a[l] = null;
else if (f > 1 && c > 1)
this._updateManyToMany && this._updateManyToMany(h, u), a[l] = null;
else if (f > 1)
for (var v = 0; v < f; v++)
this._remove && this._remove(u[v]);
else
this._remove && this._remove(u);
}
this._performRestAdd(o, a);
}, r.prototype._performRestAdd = function(e, t) {
for (var n = 0; n < e.length; n++) {
var a = e[n], i = t[a], o = ds(i);
if (o > 1)
for (var s = 0; s < o; s++)
this._add && this._add(i[s]);
else o === 1 && this._add && this._add(i);
t[a] = null;
}
}, r.prototype._initIndexMap = function(e, t, n, a) {
for (var i = this._diffModeMultiple, o = 0; o < e.length; o++) {
var s = "_ec_" + this[a](e[o], o);
if (i || (n[o] = s), !!t) {
var l = t[s], u = ds(l);
u === 0 ? (t[s] = o, i && n.push(s)) : u === 1 ? t[s] = [l, o] : l.push(o);
}
}
}, r;
}()
), gB = (
/** @class */
function() {
function r(e, t) {
this._encode = e, this._schema = t;
}
return r.prototype.get = function() {
return {
// Do not generate full dimension name until fist used.
fullDimensions: this._getFullDimensionNames(),
encode: this._encode
};
}, r.prototype._getFullDimensionNames = function() {
return this._cachedDimNames || (this._cachedDimNames = this._schema ? this._schema.makeOutputDimensionNames() : []), this._cachedDimNames;
}, r;
}()
);
function yB(r, e) {
var t = {}, n = t.encode = {}, a = X(), i = [], o = [], s = {};
A(r.dimensions, function(c) {
var v = r.getDimensionInfo(c), p = v.coordDim;
if (p) {
process.env.NODE_ENV !== "production" && tt(Rd.get(p) == null);
var d = v.coordDimIndex;
wv(n, p)[d] = c, v.isExtraCoord || (a.set(p, 1), mB(v.type) && (i[0] = c), wv(s, p)[d] = r.getDimensionIndex(v.name)), v.defaultTooltip && o.push(c);
}
Rd.each(function(g, y) {
var m = wv(n, y), _ = v.otherDims[y];
_ != null && _ !== !1 && (m[_] = v.name);
});
});
var l = [], u = {};
a.each(function(c, v) {
var p = n[v];
u[v] = p[0], l = l.concat(p);
}), t.dataDimsOnCoord = l, t.dataDimIndicesOnCoord = G(l, function(c) {
return r.getDimensionInfo(c).storeDimIndex;
}), t.encodeFirstDimNotExtra = u;
var h = n.label;
h && h.length && (i = h.slice());
var f = n.tooltip;
return f && f.length ? o = f.slice() : o.length || (o = i.slice()), n.defaultedLabel = i, n.defaultedTooltip = o, t.userOutput = new gB(s, e), t;
}
function wv(r, e) {
return r.hasOwnProperty(e) || (r[e] = []), r[e];
}
function tf(r) {
return r === "category" ? "ordinal" : r === "time" ? "time" : "float";
}
function mB(r) {
return !(r === "ordinal" || r === "time");
}
var mh = (
/** @class */
/* @__PURE__ */ function() {
function r(e) {
this.otherDims = {}, e != null && B(this, e);
}
return r;
}()
), _B = bt(), SB = {
float: "f",
int: "i",
ordinal: "o",
number: "n",
time: "t"
}, kA = (
/** @class */
function() {
function r(e) {
this.dimensions = e.dimensions, this._dimOmitted = e.dimensionOmitted, this.source = e.source, this._fullDimCount = e.fullDimensionCount, this._updateDimOmitted(e.dimensionOmitted);
}
return r.prototype.isDimensionOmitted = function() {
return this._dimOmitted;
}, r.prototype._updateDimOmitted = function(e) {
this._dimOmitted = e, e && (this._dimNameMap || (this._dimNameMap = OA(this.source)));
}, r.prototype.getSourceDimensionIndex = function(e) {
return ot(this._dimNameMap.get(e), -1);
}, r.prototype.getSourceDimension = function(e) {
var t = this.source.dimensionsDefine;
if (t)
return t[e];
}, r.prototype.makeStoreSchema = function() {
for (var e = this._fullDimCount, t = OD(this.source), n = !VA(e), a = "", i = [], o = 0, s = 0; o < e; o++) {
var l = void 0, u = void 0, h = void 0, f = this.dimensions[s];
if (f && f.storeDimIndex === o)
l = t ? f.name : null, u = f.type, h = f.ordinalMeta, s++;
else {
var c = this.getSourceDimension(o);
c && (l = t ? c.name : null, u = c.type);
}
i.push({
property: l,
type: u,
ordinalMeta: h
}), t && l != null && (!f || !f.isCalculationCoord) && (a += n ? l.replace(/\`/g, "`1").replace(/\$/g, "`2") : l), a += "$", a += SB[u] || "f", h && (a += h.uid), a += "$";
}
var v = this.source, p = [v.seriesLayoutBy, v.startIndex, a].join("$$");
return {
dimensions: i,
hash: p
};
}, r.prototype.makeOutputDimensionNames = function() {
for (var e = [], t = 0, n = 0; t < this._fullDimCount; t++) {
var a = void 0, i = this.dimensions[n];
if (i && i.storeDimIndex === t)
i.isCalculationCoord || (a = i.name), n++;
else {
var o = this.getSourceDimension(t);
o && (a = o.name);
}
e.push(a);
}
return e;
}, r.prototype.appendCalculationDimension = function(e) {
this.dimensions.push(e), e.isCalculationCoord = !0, this._fullDimCount++, this._updateDimOmitted(!0);
}, r;
}()
);
function RA(r) {
return r instanceof kA;
}
function NA(r) {
for (var e = X(), t = 0; t < (r || []).length; t++) {
var n = r[t], a = J(n) ? n.name : n;
a != null && e.get(a) == null && e.set(a, t);
}
return e;
}
function OA(r) {
var e = _B(r);
return e.dimNameMap || (e.dimNameMap = NA(r.dimensionsDefine));
}
function VA(r) {
return r > 30;
}
var gs = J, Wn = G, xB = typeof Int32Array > "u" ? Array : Int32Array, bB = "e\0\0", G1 = -1, wB = ["hasItemOption", "_nameList", "_idList", "_invertedIndicesMap", "_dimSummary", "userOutput", "_rawData", "_dimValueGetter", "_nameDimIdx", "_idDimIdx", "_nameRepeatCount"], TB = ["_approximateExtent"], F1, Mu, ys, Ki, Tv, ms, Cv, Ne = (
/** @class */
function() {
function r(e, t) {
this.type = "list", this._dimOmitted = !1, this._nameList = [], this._idList = [], this._visual = {}, this._layout = {}, this._itemVisuals = [], this._itemLayouts = [], this._graphicEls = [], this._approximateExtent = {}, this._calculationInfo = {}, this.hasItemOption = !1, this.TRANSFERABLE_METHODS = ["cloneShallow", "downSample", "minmaxDownSample", "lttbDownSample", "map"], this.CHANGABLE_METHODS = ["filterSelf", "selectRange"], this.DOWNSAMPLE_METHODS = ["downSample", "minmaxDownSample", "lttbDownSample"];
var n, a = !1;
RA(e) ? (n = e.dimensions, this._dimOmitted = e.isDimensionOmitted(), this._schema = e) : (a = !0, n = e), n = n || ["x", "y"];
for (var i = {}, o = [], s = {}, l = !1, u = {}, h = 0; h < n.length; h++) {
var f = n[h], c = U(f) ? new mh({
name: f
}) : f instanceof mh ? f : new mh(f), v = c.name;
c.type = c.type || "float", c.coordDim || (c.coordDim = v, c.coordDimIndex = 0);
var p = c.otherDims = c.otherDims || {};
o.push(v), i[v] = c, u[v] != null && (l = !0), c.createInvertedIndices && (s[v] = []), p.itemName === 0 && (this._nameDimIdx = h), p.itemId === 0 && (this._idDimIdx = h), process.env.NODE_ENV !== "production" && tt(a || c.storeDimIndex >= 0), a && (c.storeDimIndex = h);
}
if (this.dimensions = o, this._dimInfos = i, this._initGetDimensionInfo(l), this.hostModel = t, this._invertedIndicesMap = s, this._dimOmitted) {
var d = this._dimIdxToName = X();
A(o, function(g) {
d.set(i[g].storeDimIndex, g);
});
}
}
return r.prototype.getDimension = function(e) {
var t = this._recognizeDimIndex(e);
if (t == null)
return e;
if (t = e, !this._dimOmitted)
return this.dimensions[t];
var n = this._dimIdxToName.get(t);
if (n != null)
return n;
var a = this._schema.getSourceDimension(t);
if (a)
return a.name;
}, r.prototype.getDimensionIndex = function(e) {
var t = this._recognizeDimIndex(e);
if (t != null)
return t;
if (e == null)
return -1;
var n = this._getDimInfo(e);
return n ? n.storeDimIndex : this._dimOmitted ? this._schema.getSourceDimensionIndex(e) : -1;
}, r.prototype._recognizeDimIndex = function(e) {
if (Tt(e) || e != null && !isNaN(e) && !this._getDimInfo(e) && (!this._dimOmitted || this._schema.getSourceDimensionIndex(e) < 0))
return +e;
}, r.prototype._getStoreDimIndex = function(e) {
var t = this.getDimensionIndex(e);
if (process.env.NODE_ENV !== "production" && t == null)
throw new Error("Unknown dimension " + e);
return t;
}, r.prototype.getDimensionInfo = function(e) {
return this._getDimInfo(this.getDimension(e));
}, r.prototype._initGetDimensionInfo = function(e) {
var t = this._dimInfos;
this._getDimInfo = e ? function(n) {
return t.hasOwnProperty(n) ? t[n] : void 0;
} : function(n) {
return t[n];
};
}, r.prototype.getDimensionsOnCoord = function() {
return this._dimSummary.dataDimsOnCoord.slice();
}, r.prototype.mapDimension = function(e, t) {
var n = this._dimSummary;
if (t == null)
return n.encodeFirstDimNotExtra[e];
var a = n.encode[e];
return a ? a[t] : null;
}, r.prototype.mapDimensionsAll = function(e) {
var t = this._dimSummary, n = t.encode[e];
return (n || []).slice();
}, r.prototype.getStore = function() {
return this._store;
}, r.prototype.initData = function(e, t, n) {
var a = this, i;
if (e instanceof Bd && (i = e), !i) {
var o = this.dimensions, s = ky(e) || De(e) ? new VD(e, o.length) : e;
i = new Bd();
var l = Wn(o, function(u) {
return {
type: a._dimInfos[u].type,
property: u
};
});
i.initData(s, l, n);
}
this._store = i, this._nameList = (t || []).slice(), this._idList = [], this._nameRepeatCount = {}, this._doInit(0, i.count()), this._dimSummary = yB(this, this._schema), this.userOutput = this._dimSummary.userOutput;
}, r.prototype.appendData = function(e) {
var t = this._store.appendData(e);
this._doInit(t[0], t[1]);
}, r.prototype.appendValues = function(e, t) {
var n = this._store.appendValues(e, t && t.length), a = n.start, i = n.end, o = this._shouldMakeIdFromName();
if (this._updateOrdinalMeta(), t)
for (var s = a; s < i; s++) {
var l = s - a;
this._nameList[s] = t[l], o && Cv(this, s);
}
}, r.prototype._updateOrdinalMeta = function() {
for (var e = this._store, t = this.dimensions, n = 0; n < t.length; n++) {
var a = this._dimInfos[t[n]];
a.ordinalMeta && e.collectOrdinalMeta(a.storeDimIndex, a.ordinalMeta);
}
}, r.prototype._shouldMakeIdFromName = function() {
var e = this._store.getProvider();
return this._idDimIdx == null && e.getSource().sourceFormat !== wn && !e.fillStorage;
}, r.prototype._doInit = function(e, t) {
if (!(e >= t)) {
var n = this._store, a = n.getProvider();
this._updateOrdinalMeta();
var i = this._nameList, o = this._idList, s = a.getSource().sourceFormat, l = s === br;
if (l && !a.pure)
for (var u = [], h = e; h < t; h++) {
var f = a.getItem(h, u);
if (!this.hasItemOption && ak(f) && (this.hasItemOption = !0), f) {
var c = f.name;
i[h] == null && c != null && (i[h] = oe(c, null));
var v = f.id;
o[h] == null && v != null && (o[h] = oe(v, null));
}
}
if (this._shouldMakeIdFromName())
for (var h = e; h < t; h++)
Cv(this, h);
F1(this);
}
}, r.prototype.getApproximateExtent = function(e) {
return this._approximateExtent[e] || this._store.getDataExtent(this._getStoreDimIndex(e));
}, r.prototype.setApproximateExtent = function(e, t) {
t = this.getDimension(t), this._approximateExtent[t] = e.slice();
}, r.prototype.getCalculationInfo = function(e) {
return this._calculationInfo[e];
}, r.prototype.setCalculationInfo = function(e, t) {
gs(e) ? B(this._calculationInfo, e) : this._calculationInfo[e] = t;
}, r.prototype.getName = function(e) {
var t = this.getRawIndex(e), n = this._nameList[t];
return n == null && this._nameDimIdx != null && (n = ys(this, this._nameDimIdx, t)), n == null && (n = ""), n;
}, r.prototype._getCategory = function(e, t) {
var n = this._store.get(e, t), a = this._store.getOrdinalMeta(e);
return a ? a.categories[n] : n;
}, r.prototype.getId = function(e) {
return Mu(this, this.getRawIndex(e));
}, r.prototype.count = function() {
return this._store.count();
}, r.prototype.get = function(e, t) {
var n = this._store, a = this._dimInfos[e];
if (a)
return n.get(a.storeDimIndex, t);
}, r.prototype.getByRawIndex = function(e, t) {
var n = this._store, a = this._dimInfos[e];
if (a)
return n.getByRawIndex(a.storeDimIndex, t);
}, r.prototype.getIndices = function() {
return this._store.getIndices();
}, r.prototype.getDataExtent = function(e) {
return this._store.getDataExtent(this._getStoreDimIndex(e));
}, r.prototype.getSum = function(e) {
return this._store.getSum(this._getStoreDimIndex(e));
}, r.prototype.getMedian = function(e) {
return this._store.getMedian(this._getStoreDimIndex(e));
}, r.prototype.getValues = function(e, t) {
var n = this, a = this._store;
return z(e) ? a.getValues(Wn(e, function(i) {
return n._getStoreDimIndex(i);
}), t) : a.getValues(e);
}, r.prototype.hasValue = function(e) {
for (var t = this._dimSummary.dataDimIndicesOnCoord, n = 0, a = t.length; n < a; n++)
if (isNaN(this._store.get(t[n], e)))
return !1;
return !0;
}, r.prototype.indexOfName = function(e) {
for (var t = 0, n = this._store.count(); t < n; t++)
if (this.getName(t) === e)
return t;
return -1;
}, r.prototype.getRawIndex = function(e) {
return this._store.getRawIndex(e);
}, r.prototype.indexOfRawIndex = function(e) {
return this._store.indexOfRawIndex(e);
}, r.prototype.rawIndexOf = function(e, t) {
var n = e && this._invertedIndicesMap[e];
if (process.env.NODE_ENV !== "production" && !n)
throw new Error("Do not supported yet");
var a = n && n[t];
return a == null || isNaN(a) ? G1 : a;
}, r.prototype.indicesOfNearest = function(e, t, n) {
return this._store.indicesOfNearest(this._getStoreDimIndex(e), t, n);
}, r.prototype.each = function(e, t, n) {
K(e) && (n = t, t = e, e = []);
var a = n || this, i = Wn(Ki(e), this._getStoreDimIndex, this);
this._store.each(i, a ? Y(t, a) : t);
}, r.prototype.filterSelf = function(e, t, n) {
K(e) && (n = t, t = e, e = []);
var a = n || this, i = Wn(Ki(e), this._getStoreDimIndex, this);
return this._store = this._store.filter(i, a ? Y(t, a) : t), this;
}, r.prototype.selectRange = function(e) {
var t = this, n = {}, a = St(e);
return A(a, function(i) {
var o = t._getStoreDimIndex(i);
n[o] = e[i];
}), this._store = this._store.selectRange(n), this;
}, r.prototype.mapArray = function(e, t, n) {
K(e) && (n = t, t = e, e = []), n = n || this;
var a = [];
return this.each(e, function() {
a.push(t && t.apply(this, arguments));
}, n), a;
}, r.prototype.map = function(e, t, n, a) {
var i = n || a || this, o = Wn(Ki(e), this._getStoreDimIndex, this), s = ms(this);
return s._store = this._store.map(o, i ? Y(t, i) : t), s;
}, r.prototype.modify = function(e, t, n, a) {
var i = this, o = n || a || this;
process.env.NODE_ENV !== "production" && A(Ki(e), function(l) {
var u = i.getDimensionInfo(l);
u.isCalculationCoord || console.error("Danger: only stack dimension can be modified");
});
var s = Wn(Ki(e), this._getStoreDimIndex, this);
this._store.modify(s, o ? Y(t, o) : t);
}, r.prototype.downSample = function(e, t, n, a) {
var i = ms(this);
return i._store = this._store.downSample(this._getStoreDimIndex(e), t, n, a), i;
}, r.prototype.minmaxDownSample = function(e, t) {
var n = ms(this);
return n._store = this._store.minmaxDownSample(this._getStoreDimIndex(e), t), n;
}, r.prototype.lttbDownSample = function(e, t) {
var n = ms(this);
return n._store = this._store.lttbDownSample(this._getStoreDimIndex(e), t), n;
}, r.prototype.getRawDataItem = function(e) {
return this._store.getRawDataItem(e);
}, r.prototype.getItemModel = function(e) {
var t = this.hostModel, n = this.getRawDataItem(e);
return new It(n, t, t && t.ecModel);
}, r.prototype.diff = function(e) {
var t = this;
return new Ln(e ? e.getStore().getIndices() : [], this.getStore().getIndices(), function(n) {
return Mu(e, n);
}, function(n) {
return Mu(t, n);
});
}, r.prototype.getVisual = function(e) {
var t = this._visual;
return t && t[e];
}, r.prototype.setVisual = function(e, t) {
this._visual = this._visual || {}, gs(e) ? B(this._visual, e) : this._visual[e] = t;
}, r.prototype.getItemVisual = function(e, t) {
var n = this._itemVisuals[e], a = n && n[t];
return a ?? this.getVisual(t);
}, r.prototype.hasItemVisual = function() {
return this._itemVisuals.length > 0;
}, r.prototype.ensureUniqueItemVisual = function(e, t) {
var n = this._itemVisuals, a = n[e];
a || (a = n[e] = {});
var i = a[t];
return i == null && (i = this.getVisual(t), z(i) ? i = i.slice() : gs(i) && (i = B({}, i)), a[t] = i), i;
}, r.prototype.setItemVisual = function(e, t, n) {
var a = this._itemVisuals[e] || {};
this._itemVisuals[e] = a, gs(t) ? B(a, t) : a[t] = n;
}, r.prototype.clearAllVisual = function() {
this._visual = {}, this._itemVisuals = [];
}, r.prototype.setLayout = function(e, t) {
gs(e) ? B(this._layout, e) : this._layout[e] = t;
}, r.prototype.getLayout = function(e) {
return this._layout[e];
}, r.prototype.getItemLayout = function(e) {
return this._itemLayouts[e];
}, r.prototype.setItemLayout = function(e, t, n) {
this._itemLayouts[e] = n ? B(this._itemLayouts[e] || {}, t) : t;
}, r.prototype.clearItemLayouts = function() {
this._itemLayouts.length = 0;
}, r.prototype.setItemGraphicEl = function(e, t) {
var n = this.hostModel && this.hostModel.seriesIndex;
Td(n, this.dataType, e, t), this._graphicEls[e] = t;
}, r.prototype.getItemGraphicEl = function(e) {
return this._graphicEls[e];
}, r.prototype.eachItemGraphicEl = function(e, t) {
A(this._graphicEls, function(n, a) {
n && e && e.call(t, n, a);
});
}, r.prototype.cloneShallow = function(e) {
return e || (e = new r(this._schema ? this._schema : Wn(this.dimensions, this._getDimInfo, this), this.hostModel)), Tv(e, this), e._store = this._store, e;
}, r.prototype.wrapMethod = function(e, t) {
var n = this[e];
K(n) && (this.__wrappedMethods = this.__wrappedMethods || [], this.__wrappedMethods.push(e), this[e] = function() {
var a = n.apply(this, arguments);
return t.apply(this, [a].concat(Jg(arguments)));
});
}, r.internalField = function() {
F1 = function(e) {
var t = e._invertedIndicesMap;
A(t, function(n, a) {
var i = e._dimInfos[a], o = i.ordinalMeta, s = e._store;
if (o) {
n = t[a] = new xB(o.categories.length);
for (var l = 0; l < n.length; l++)
n[l] = G1;
for (var l = 0; l < s.count(); l++)
n[s.get(i.storeDimIndex, l)] = l;
}
});
}, ys = function(e, t, n) {
return oe(e._getCategory(t, n), null);
}, Mu = function(e, t) {
var n = e._idList[t];
return n == null && e._idDimIdx != null && (n = ys(e, e._idDimIdx, t)), n == null && (n = bB + t), n;
}, Ki = function(e) {
return z(e) || (e = e != null ? [e] : []), e;
}, ms = function(e) {
var t = new r(e._schema ? e._schema : Wn(e.dimensions, e._getDimInfo, e), e.hostModel);
return Tv(t, e), t;
}, Tv = function(e, t) {
A(wB.concat(t.__wrappedMethods || []), function(n) {
t.hasOwnProperty(n) && (e[n] = t[n]);
}), e.__wrappedMethods = t.__wrappedMethods, A(TB, function(n) {
e[n] = nt(t[n]);
}), e._calculationInfo = B({}, t._calculationInfo);
}, Cv = function(e, t) {
var n = e._nameList, a = e._idList, i = e._nameDimIdx, o = e._idDimIdx, s = n[t], l = a[t];
if (s == null && i != null && (n[t] = s = ys(e, i, t)), l == null && o != null && (a[t] = l = ys(e, o, t)), l == null && s != null) {
var u = e._nameRepeatCount, h = u[s] = (u[s] || 0) + 1;
l = s, h > 1 && (l += "__ec__" + h), a[t] = l;
}
};
}(), r;
}()
);
function $l(r, e) {
ky(r) || (r = Ry(r)), e = e || {};
var t = e.coordDimensions || [], n = e.dimensionsDefine || r.dimensionsDefine || [], a = X(), i = [], o = DB(r, t, n, e.dimensionsCount), s = e.canOmitUnusedDimensions && VA(o), l = n === r.dimensionsDefine, u = l ? OA(r) : NA(n), h = e.encodeDefine;
!h && e.encodeDefaulter && (h = e.encodeDefaulter(r, o));
for (var f = X(h), c = new UD(o), v = 0; v < c.length; v++)
c[v] = -1;
function p(C) {
var D = c[C];
if (D < 0) {
var M = n[C], I = J(M) ? M : {
name: M
}, L = new mh(), E = I.name;
E != null && u.get(E) != null && (L.name = L.displayName = E), I.type != null && (L.type = I.type), I.displayName != null && (L.displayName = I.displayName);
var P = i.length;
return c[C] = P, L.storeDimIndex = C, i.push(L), L;
}
return i[D];
}
if (!s)
for (var v = 0; v < o; v++)
p(v);
f.each(function(C, D) {
var M = Pt(C).slice();
if (M.length === 1 && !U(M[0]) && M[0] < 0) {
f.set(D, !1);
return;
}
var I = f.set(D, []);
A(M, function(L, E) {
var P = U(L) ? u.get(L) : L;
P != null && P < o && (I[E] = P, g(p(P), D, E));
});
});
var d = 0;
A(t, function(C) {
var D, M, I, L;
if (U(C))
D = C, L = {};
else {
L = C, D = L.name;
var E = L.ordinalMeta;
L.ordinalMeta = null, L = B({}, L), L.ordinalMeta = E, M = L.dimsDef, I = L.otherDims, L.name = L.coordDim = L.coordDimIndex = L.dimsDef = L.otherDims = null;
}
var P = f.get(D);
if (P !== !1) {
if (P = Pt(P), !P.length)
for (var k = 0; k < (M && M.length || 1); k++) {
for (; d < o && p(d).coordDim != null; )
d++;
d < o && P.push(d++);
}
A(P, function(N, R) {
var V = p(N);
if (l && L.type != null && (V.type = L.type), g(et(V, L), D, R), V.name == null && M) {
var F = M[R];
!J(F) && (F = {
name: F
}), V.name = V.displayName = F.name, V.defaultTooltip = F.defaultTooltip;
}
I && et(V.otherDims, I);
});
}
});
function g(C, D, M) {
Rd.get(D) != null ? C.otherDims[D] = M : (C.coordDim = D, C.coordDimIndex = M, a.set(D, !0));
}
var y = e.generateCoord, m = e.generateCoordCount, _ = m != null;
m = y ? m || 1 : 0;
var S = y || "value";
function x(C) {
C.name == null && (C.name = C.coordDim);
}
if (s)
A(i, function(C) {
x(C);
}), i.sort(function(C, D) {
return C.storeDimIndex - D.storeDimIndex;
});
else
for (var b = 0; b < o; b++) {
var w = p(b), T = w.coordDim;
T == null && (w.coordDim = AB(S, a, _), w.coordDimIndex = 0, (!y || m <= 0) && (w.isExtraCoord = !0), m--), x(w), w.type == null && (ID(r, b) === ye.Must || w.isExtraCoord && (w.otherDims.itemName != null || w.otherDims.seriesName != null)) && (w.type = "ordinal");
}
return CB(i), new kA({
source: r,
dimensions: i,
fullDimensionCount: o,
dimensionOmitted: s
});
}
function CB(r) {
for (var e = X(), t = 0; t < r.length; t++) {
var n = r[t], a = n.name, i = e.get(a) || 0;
i > 0 && (n.name = a + (i - 1)), i++, e.set(a, i);
}
}
function DB(r, e, t, n) {
var a = Math.max(r.dimensionsDetectedCount || 1, e.length, t.length, n || 0);
return A(e, function(i) {
var o;
J(i) && (o = i.dimsDef) && (a = Math.max(a, o.length));
}), a;
}
function AB(r, e, t) {
if (t || e.hasKey(r)) {
for (var n = 0; e.hasKey(r + n); )
n++;
r += n;
}
return e.set(r, !0), r;
}
var MB = (
/** @class */
/* @__PURE__ */ function() {
function r(e) {
this.coordSysDims = [], this.axisMap = X(), this.categoryAxisMap = X(), this.coordSysName = e;
}
return r;
}()
);
function IB(r) {
var e = r.get("coordinateSystem"), t = new MB(e), n = LB[e];
if (n)
return n(r, t, t.axisMap, t.categoryAxisMap), t;
}
var LB = {
cartesian2d: function(r, e, t, n) {
var a = r.getReferringComponents("xAxis", ne).models[0], i = r.getReferringComponents("yAxis", ne).models[0];
if (process.env.NODE_ENV !== "production") {
if (!a)
throw new Error('xAxis "' + re(r.get("xAxisIndex"), r.get("xAxisId"), 0) + '" not found');
if (!i)
throw new Error('yAxis "' + re(r.get("xAxisIndex"), r.get("yAxisId"), 0) + '" not found');
}
e.coordSysDims = ["x", "y"], t.set("x", a), t.set("y", i), ji(a) && (n.set("x", a), e.firstCategoryDimIndex = 0), ji(i) && (n.set("y", i), e.firstCategoryDimIndex == null && (e.firstCategoryDimIndex = 1));
},
singleAxis: function(r, e, t, n) {
var a = r.getReferringComponents("singleAxis", ne).models[0];
if (process.env.NODE_ENV !== "production" && !a)
throw new Error("singleAxis should be specified.");
e.coordSysDims = ["single"], t.set("single", a), ji(a) && (n.set("single", a), e.firstCategoryDimIndex = 0);
},
polar: function(r, e, t, n) {
var a = r.getReferringComponents("polar", ne).models[0], i = a.findAxisModel("radiusAxis"), o = a.findAxisModel("angleAxis");
if (process.env.NODE_ENV !== "production") {
if (!o)
throw new Error("angleAxis option not found");
if (!i)
throw new Error("radiusAxis option not found");
}
e.coordSysDims = ["radius", "angle"], t.set("radius", i), t.set("angle", o), ji(i) && (n.set("radius", i), e.firstCategoryDimIndex = 0), ji(o) && (n.set("angle", o), e.firstCategoryDimIndex == null && (e.firstCategoryDimIndex = 1));
},
geo: function(r, e, t, n) {
e.coordSysDims = ["lng", "lat"];
},
parallel: function(r, e, t, n) {
var a = r.ecModel, i = a.getComponent("parallel", r.get("parallelIndex")), o = e.coordSysDims = i.dimensions.slice();
A(i.parallelAxisIndex, function(s, l) {
var u = a.getComponent("parallelAxis", s), h = o[l];
t.set(h, u), ji(u) && (n.set(h, u), e.firstCategoryDimIndex == null && (e.firstCategoryDimIndex = l));
});
}
};
function ji(r) {
return r.get("type") === "category";
}
function EB(r, e, t) {
t = t || {};
var n = t.byIndex, a = t.stackedCoordDimension, i, o, s;
PB(e) ? i = e : (o = e.schema, i = o.dimensions, s = e.store);
var l = !!(r && r.get("stack")), u, h, f, c;
if (A(i, function(m, _) {
U(m) && (i[_] = m = {
name: m
}), l && !m.isExtraCoord && (!n && !u && m.ordinalMeta && (u = m), !h && m.type !== "ordinal" && m.type !== "time" && (!a || a === m.coordDim) && (h = m));
}), h && !n && !u && (n = !0), h) {
f = "__\0ecstackresult_" + r.id, c = "__\0ecstackedover_" + r.id, u && (u.createInvertedIndices = !0);
var v = h.coordDim, p = h.type, d = 0;
A(i, function(m) {
m.coordDim === v && d++;
});
var g = {
name: f,
coordDim: v,
coordDimIndex: d,
type: p,
isExtraCoord: !0,
isCalculationCoord: !0,
storeDimIndex: i.length
}, y = {
name: c,
// This dimension contains stack base (generally, 0), so do not set it as
// `stackedDimCoordDim` to avoid extent calculation, consider log scale.
coordDim: c,
coordDimIndex: d + 1,
type: p,
isExtraCoord: !0,
isCalculationCoord: !0,
storeDimIndex: i.length + 1
};
o ? (s && (g.storeDimIndex = s.ensureCalculationDimension(c, p), y.storeDimIndex = s.ensureCalculationDimension(f, p)), o.appendCalculationDimension(g), o.appendCalculationDimension(y)) : (i.push(g), i.push(y));
}
return {
stackedDimension: h && h.name,
stackedByDimension: u && u.name,
isStackedByIndex: n,
stackedOverDimension: c,
stackResultDimension: f
};
}
function PB(r) {
return !RA(r.schema);
}
function da(r, e) {
return !!e && e === r.getCalculationInfo("stackedDimension");
}
function BA(r, e) {
return da(r, e) ? r.getCalculationInfo("stackResultDimension") : e;
}
function kB(r, e) {
var t = r.get("coordinateSystem"), n = Yo.get(t), a;
return e && e.coordSysDims && (a = G(e.coordSysDims, function(i) {
var o = {
name: i
}, s = e.axisMap.get(i);
if (s) {
var l = s.get("type");
o.type = tf(l);
}
return o;
})), a || (a = n && (n.getDimensionsInfo ? n.getDimensionsInfo() : n.dimensions.slice()) || ["x", "y"]), a;
}
function RB(r, e, t) {
var n, a;
return t && A(r, function(i, o) {
var s = i.coordDim, l = t.categoryAxisMap.get(s);
l && (n == null && (n = o), i.ordinalMeta = l.getOrdinalMeta(), e && (i.createInvertedIndices = !0)), i.otherDims.itemName != null && (a = !0);
}), !a && n != null && (r[n].otherDims.itemName = 0), n;
}
function On(r, e, t) {
t = t || {};
var n = e.getSourceManager(), a, i = !1;
r ? (i = !0, a = Ry(r)) : (a = n.getSource(), i = a.sourceFormat === br);
var o = IB(e), s = kB(e, o), l = t.useEncodeDefaulter, u = K(l) ? l : l ? ut(MD, s, e) : null, h = {
coordDimensions: s,
generateCoord: t.generateCoord,
encodeDefine: e.getEncode(),
encodeDefaulter: u,
canOmitUnusedDimensions: !i
}, f = $l(a, h), c = RB(f.dimensions, t.createInvertedIndices, o), v = i ? null : n.getSharedDataStore(f), p = EB(e, {
schema: f,
store: v
}), d = new Ne(f, e);
d.setCalculationInfo(p);
var g = c != null && NB(a) ? function(y, m, _, S) {
return S === c ? _ : this.defaultDimValueGetter(y, m, _, S);
} : null;
return d.hasItemOption = !1, d.initData(
// Try to reuse the data store in sourceManager if using dataset.
i ? a : v,
null,
g
), d;
}
function NB(r) {
if (r.sourceFormat === br) {
var e = OB(r.data || []);
return !z(Bo(e));
}
}
function OB(r) {
for (var e = 0; e < r.length && r[e] == null; )
e++;
return r[e];
}
var hn = (
/** @class */
function() {
function r(e) {
this._setting = e || {}, this._extent = [1 / 0, -1 / 0];
}
return r.prototype.getSetting = function(e) {
return this._setting[e];
}, r.prototype.unionExtent = function(e) {
var t = this._extent;
e[0] < t[0] && (t[0] = e[0]), e[1] > t[1] && (t[1] = e[1]);
}, r.prototype.unionExtentFromData = function(e, t) {
this.unionExtent(e.getApproximateExtent(t));
}, r.prototype.getExtent = function() {
return this._extent.slice();
}, r.prototype.setExtent = function(e, t) {
var n = this._extent;
isNaN(e) || (n[0] = e), isNaN(t) || (n[1] = t);
}, r.prototype.isInExtentRange = function(e) {
return this._extent[0] <= e && this._extent[1] >= e;
}, r.prototype.isBlank = function() {
return this._isBlank;
}, r.prototype.setBlank = function(e) {
this._isBlank = e;
}, r;
}()
);
zf(hn);
var VB = 0, Xd = (
/** @class */
function() {
function r(e) {
this.categories = e.categories || [], this._needCollect = e.needCollect, this._deduplication = e.deduplication, this.uid = ++VB;
}
return r.createByAxisModel = function(e) {
var t = e.option, n = t.data, a = n && G(n, BB);
return new r({
categories: a,
needCollect: !a,
// deduplication is default in axis.
deduplication: t.dedplication !== !1
});
}, r.prototype.getOrdinal = function(e) {
return this._getOrCreateMap().get(e);
}, r.prototype.parseAndCollect = function(e) {
var t, n = this._needCollect;
if (!U(e) && !n)
return e;
if (n && !this._deduplication)
return t = this.categories.length, this.categories[t] = e, t;
var a = this._getOrCreateMap();
return t = a.get(e), t == null && (n ? (t = this.categories.length, this.categories[t] = e, a.set(e, t)) : t = NaN), t;
}, r.prototype._getOrCreateMap = function() {
return this._map || (this._map = X(this.categories));
}, r;
}()
);
function BB(r) {
return J(r) && r.value != null ? r.value : r + "";
}
function zB(r) {
var e = Math.pow(10, Vf(Math.abs(r))), t = Math.abs(r / e);
return t === 0 || t === 1 || t === 2 || t === 3 || t === 5;
}
function qd(r) {
return r.type === "interval" || r.type === "log";
}
function GB(r, e, t, n) {
var a = {}, i = r[1] - r[0], o = a.interval = dC(i / e);
t != null && o < t && (o = a.interval = t), n != null && o > n && (o = a.interval = n);
var s = a.intervalPrecision = zA(o), l = a.niceTickExtent = [jt(Math.ceil(r[0] / o) * o, s), jt(Math.floor(r[1] / o) * o, s)];
return FB(l, r), a;
}
function Dv(r) {
var e = Math.pow(10, Vf(r)), t = r / e;
return t ? t === 2 ? t = 3 : t === 3 ? t = 5 : t *= 2 : t = 1, jt(t * e);
}
function zA(r) {
return Kr(r) + 2;
}
function H1(r, e, t) {
r[e] = Math.max(Math.min(r[e], t[1]), t[0]);
}
function FB(r, e) {
!isFinite(r[0]) && (r[0] = e[0]), !isFinite(r[1]) && (r[1] = e[1]), H1(r, 0, e), H1(r, 1, e), r[0] > r[1] && (r[0] = r[1]);
}
function oc(r, e) {
return r >= e[0] && r <= e[1];
}
function sc(r, e) {
return e[1] === e[0] ? 0.5 : (r - e[0]) / (e[1] - e[0]);
}
function lc(r, e) {
return r * (e[1] - e[0]) + e[0];
}
var uc = (
/** @class */
function(r) {
O(e, r);
function e(t) {
var n = r.call(this, t) || this;
n.type = "ordinal";
var a = n.getSetting("ordinalMeta");
return a || (a = new Xd({})), z(a) && (a = new Xd({
categories: G(a, function(i) {
return J(i) ? i.value : i;
})
})), n._ordinalMeta = a, n._extent = n.getSetting("extent") || [0, a.categories.length - 1], n;
}
return e.prototype.parse = function(t) {
return t == null ? NaN : U(t) ? this._ordinalMeta.getOrdinal(t) : Math.round(t);
}, e.prototype.contain = function(t) {
return t = this.parse(t), oc(t, this._extent) && this._ordinalMeta.categories[t] != null;
}, e.prototype.normalize = function(t) {
return t = this._getTickNumber(this.parse(t)), sc(t, this._extent);
}, e.prototype.scale = function(t) {
return t = Math.round(lc(t, this._extent)), this.getRawOrdinalNumber(t);
}, e.prototype.getTicks = function() {
for (var t = [], n = this._extent, a = n[0]; a <= n[1]; )
t.push({
value: a
}), a++;
return t;
}, e.prototype.getMinorTicks = function(t) {
}, e.prototype.setSortInfo = function(t) {
if (t == null) {
this._ordinalNumbersByTick = this._ticksByOrdinalNumber = null;
return;
}
for (var n = t.ordinalNumbers, a = this._ordinalNumbersByTick = [], i = this._ticksByOrdinalNumber = [], o = 0, s = this._ordinalMeta.categories.length, l = Math.min(s, n.length); o < l; ++o) {
var u = n[o];
a[o] = u, i[u] = o;
}
for (var h = 0; o < s; ++o) {
for (; i[h] != null; )
h++;
a.push(h), i[h] = o;
}
}, e.prototype._getTickNumber = function(t) {
var n = this._ticksByOrdinalNumber;
return n && t >= 0 && t < n.length ? n[t] : t;
}, e.prototype.getRawOrdinalNumber = function(t) {
var n = this._ordinalNumbersByTick;
return n && t >= 0 && t < n.length ? n[t] : t;
}, e.prototype.getLabel = function(t) {
if (!this.isBlank()) {
var n = this.getRawOrdinalNumber(t.value), a = this._ordinalMeta.categories[n];
return a == null ? "" : a + "";
}
}, e.prototype.count = function() {
return this._extent[1] - this._extent[0] + 1;
}, e.prototype.unionExtentFromData = function(t, n) {
this.unionExtent(t.getApproximateExtent(n));
}, e.prototype.isInExtentRange = function(t) {
return t = this._getTickNumber(t), this._extent[0] <= t && this._extent[1] >= t;
}, e.prototype.getOrdinalMeta = function() {
return this._ordinalMeta;
}, e.prototype.calcNiceTicks = function() {
}, e.prototype.calcNiceExtent = function() {
}, e.type = "ordinal", e;
}(hn)
);
hn.registerClass(uc);
var Ga = jt, En = (
/** @class */
function(r) {
O(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t.type = "interval", t._interval = 0, t._intervalPrecision = 2, t;
}
return e.prototype.parse = function(t) {
return t;
}, e.prototype.contain = function(t) {
return oc(t, this._extent);
}, e.prototype.normalize = function(t) {
return sc(t, this._extent);
}, e.prototype.scale = function(t) {
return lc(t, this._extent);
}, e.prototype.setExtent = function(t, n) {
var a = this._extent;
isNaN(t) || (a[0] = parseFloat(t)), isNaN(n) || (a[1] = parseFloat(n));
}, e.prototype.unionExtent = function(t) {
var n = this._extent;
t[0] < n[0] && (n[0] = t[0]), t[1] > n[1] && (n[1] = t[1]), this.setExtent(n[0], n[1]);
}, e.prototype.getInterval = function() {
return this._interval;
}, e.prototype.setInterval = function(t) {
this._interval = t, this._niceExtent = this._extent.slice(), this._intervalPrecision = zA(t);
}, e.prototype.getTicks = function(t) {
var n = this._interval, a = this._extent, i = this._niceExtent, o = this._intervalPrecision, s = [];
if (!n)
return s;
var l = 1e4;
a[0] < i[0] && (t ? s.push({
value: Ga(i[0] - n, o)
}) : s.push({
value: a[0]
}));
for (var u = i[0]; u <= i[1] && (s.push({
value: u
}), u = Ga(u + n, o), u !== s[s.length - 1].value); )
if (s.length > l)
return [];
var h = s.length ? s[s.length - 1].value : i[1];
return a[1] > h && (t ? s.push({
value: Ga(h + n, o)
}) : s.push({
value: a[1]
})), s;
}, e.prototype.getMinorTicks = function(t) {
for (var n = this.getTicks(!0), a = [], i = this.getExtent(), o = 1; o < n.length; o++) {
for (var s = n[o], l = n[o - 1], u = 0, h = [], f = s.value - l.value, c = f / t; u < t - 1; ) {
var v = Ga(l.value + (u + 1) * c);
v > i[0] && v < i[1] && h.push(v), u++;
}
a.push(h);
}
return a;
}, e.prototype.getLabel = function(t, n) {
if (t == null)
return "";
var a = n && n.precision;
a == null ? a = Kr(t.value) || 0 : a === "auto" && (a = this._intervalPrecision);
var i = Ga(t.value, a, !0);
return SD(i);
}, e.prototype.calcNiceTicks = function(t, n, a) {
t = t || 5;
var i = this._extent, o = i[1] - i[0];
if (isFinite(o)) {
o < 0 && (o = -o, i.reverse());
var s = GB(i, t, n, a);
this._intervalPrecision = s.intervalPrecision, this._interval = s.interval, this._niceExtent = s.niceTickExtent;
}
}, e.prototype.calcNiceExtent = function(t) {
var n = this._extent;
if (n[0] === n[1])
if (n[0] !== 0) {
var a = Math.abs(n[0]);
t.fixMax || (n[1] += a / 2), n[0] -= a / 2;
} else
n[1] = 1;
var i = n[1] - n[0];
isFinite(i) || (n[0] = 0, n[1] = 1), this.calcNiceTicks(t.splitNumber, t.minInterval, t.maxInterval);
var o = this._interval;
t.fixMin || (n[0] = Ga(Math.floor(n[0] / o) * o)), t.fixMax || (n[1] = Ga(Math.ceil(n[1] / o) * o));
}, e.prototype.setNiceExtent = function(t, n) {
this._niceExtent = [t, n];
}, e.type = "interval", e;
}(hn)
);
hn.registerClass(En);
var GA = typeof Float32Array < "u", HB = GA ? Float32Array : Array;
function Qr(r) {
return z(r) ? GA ? new Float32Array(r) : r : new HB(r);
}
var Kd = "__ec_stack_";
function FA(r) {
return r.get("stack") || Kd + r.seriesIndex;
}
function Uy(r) {
return r.dim + r.index;
}
function WB(r) {
var e = [], t = r.axis, n = "axis0";
if (t.type === "category") {
for (var a = t.getBandWidth(), i = 0; i < r.count; i++)
e.push(et({
bandWidth: a,
axisKey: n,
stackId: Kd + i
}, r));
for (var o = $A(e), s = [], i = 0; i < r.count; i++) {
var l = o[n][Kd + i];
l.offsetCenter = l.offset + l.width / 2, s.push(l);
}
return s;
}
}
function HA(r, e) {
var t = [];
return e.eachSeriesByType(r, function(n) {
ZA(n) && t.push(n);
}), t;
}
function $B(r) {
var e = {};
A(r, function(l) {
var u = l.coordinateSystem, h = u.getBaseAxis();
if (!(h.type !== "time" && h.type !== "value"))
for (var f = l.getData(), c = h.dim + "_" + h.index, v = f.getDimensionIndex(f.mapDimension(h.dim)), p = f.getStore(), d = 0, g = p.count(); d < g; ++d) {
var y = p.get(v, d);
e[c] ? e[c].push(y) : e[c] = [y];
}
});
var t = {};
for (var n in e)
if (e.hasOwnProperty(n)) {
var a = e[n];
if (a) {
a.sort(function(l, u) {
return l - u;
});
for (var i = null, o = 1; o < a.length; ++o) {
var s = a[o] - a[o - 1];
s > 0 && (i = i === null ? s : Math.min(i, s));
}
t[n] = i;
}
}
return t;
}
function WA(r) {
var e = $B(r), t = [];
return A(r, function(n) {
var a = n.coordinateSystem, i = a.getBaseAxis(), o = i.getExtent(), s;
if (i.type === "category")
s = i.getBandWidth();
else if (i.type === "value" || i.type === "time") {
var l = i.dim + "_" + i.index, u = e[l], h = Math.abs(o[1] - o[0]), f = i.scale.getExtent(), c = Math.abs(f[1] - f[0]);
s = u ? h / c * u : h;
} else {
var v = n.getData();
s = Math.abs(o[1] - o[0]) / v.count();
}
var p = W(n.get("barWidth"), s), d = W(n.get("barMaxWidth"), s), g = W(
// barMinWidth by default is 0.5 / 1 in cartesian. Because in value axis,
// the auto-calculated bar width might be less than 0.5 / 1.
n.get("barMinWidth") || (XA(n) ? 0.5 : 1),
s
), y = n.get("barGap"), m = n.get("barCategoryGap");
t.push({
bandWidth: s,
barWidth: p,
barMaxWidth: d,
barMinWidth: g,
barGap: y,
barCategoryGap: m,
axisKey: Uy(i),
stackId: FA(n)
});
}), $A(t);
}
function $A(r) {
var e = {};
A(r, function(n, a) {
var i = n.axisKey, o = n.bandWidth, s = e[i] || {
bandWidth: o,
remainedWidth: o,
autoWidthCount: 0,
categoryGap: null,
gap: "20%",
stacks: {}
}, l = s.stacks;
e[i] = s;
var u = n.stackId;
l[u] || s.autoWidthCount++, l[u] = l[u] || {
width: 0,
maxWidth: 0
};
var h = n.barWidth;
h && !l[u].width && (l[u].width = h, h = Math.min(s.remainedWidth, h), s.remainedWidth -= h);
var f = n.barMaxWidth;
f && (l[u].maxWidth = f);
var c = n.barMinWidth;
c && (l[u].minWidth = c);
var v = n.barGap;
v != null && (s.gap = v);
var p = n.barCategoryGap;
p != null && (s.categoryGap = p);
});
var t = {};
return A(e, function(n, a) {
t[a] = {};
var i = n.stacks, o = n.bandWidth, s = n.categoryGap;
if (s == null) {
var l = St(i).length;
s = Math.max(35 - l * 4, 15) + "%";
}
var u = W(s, o), h = W(n.gap, 1), f = n.remainedWidth, c = n.autoWidthCount, v = (f - u) / (c + (c - 1) * h);
v = Math.max(v, 0), A(i, function(y) {
var m = y.maxWidth, _ = y.minWidth;
if (y.width) {
var S = y.width;
m && (S = Math.min(S, m)), _ && (S = Math.max(S, _)), y.width = S, f -= S + h * S, c--;
} else {
var S = v;
m && m < S && (S = Math.min(m, f)), _ && _ > S && (S = _), S !== v && (y.width = S, f -= S + h * S, c--);
}
}), v = (f - u) / (c + (c - 1) * h), v = Math.max(v, 0);
var p = 0, d;
A(i, function(y, m) {
y.width || (y.width = v), d = y, p += y.width * (1 + h);
}), d && (p -= d.width * h);
var g = -p / 2;
A(i, function(y, m) {
t[a][m] = t[a][m] || {
bandWidth: o,
offset: g,
width: y.width
}, g += y.width * (1 + h);
});
}), t;
}
function UB(r, e, t) {
if (r && e) {
var n = r[Uy(e)];
return n;
}
}
function UA(r, e) {
var t = HA(r, e), n = WA(t);
A(t, function(a) {
var i = a.getData(), o = a.coordinateSystem, s = o.getBaseAxis(), l = FA(a), u = n[Uy(s)][l], h = u.offset, f = u.width;
i.setLayout({
bandWidth: u.bandWidth,
offset: h,
size: f
});
});
}
function YA(r) {
return {
seriesType: r,
plan: Zo(),
reset: function(e) {
if (ZA(e)) {
var t = e.getData(), n = e.coordinateSystem, a = n.getBaseAxis(), i = n.getOtherAxis(a), o = t.getDimensionIndex(t.mapDimension(i.dim)), s = t.getDimensionIndex(t.mapDimension(a.dim)), l = e.get("showBackground", !0), u = t.mapDimension(i.dim), h = t.getCalculationInfo("stackResultDimension"), f = da(t, u) && !!t.getCalculationInfo("stackedOnSeries"), c = i.isHorizontal(), v = YB(a, i), p = XA(e), d = e.get("barMinHeight") || 0, g = h && t.getDimensionIndex(h), y = t.getLayout("size"), m = t.getLayout("offset");
return {
progress: function(_, S) {
for (var x = _.count, b = p && Qr(x * 3), w = p && l && Qr(x * 3), T = p && Qr(x), C = n.master.getRect(), D = c ? C.width : C.height, M, I = S.getStore(), L = 0; (M = _.next()) != null; ) {
var E = I.get(f ? g : o, M), P = I.get(s, M), k = v, N = void 0;
f && (N = +E - I.get(o, M));
var R = void 0, V = void 0, F = void 0, H = void 0;
if (c) {
var $ = n.dataToPoint([E, P]);
if (f) {
var j = n.dataToPoint([N, P]);
k = j[0];
}
R = k, V = $[1] + m, F = $[0] - k, H = y, Math.abs(F) < d && (F = (F < 0 ? -1 : 1) * d);
} else {
var $ = n.dataToPoint([P, E]);
if (f) {
var j = n.dataToPoint([P, N]);
k = j[1];
}
R = $[0] + m, V = k, F = y, H = $[1] - k, Math.abs(H) < d && (H = (H <= 0 ? -1 : 1) * d);
}
p ? (b[L] = R, b[L + 1] = V, b[L + 2] = c ? F : H, w && (w[L] = c ? C.x : R, w[L + 1] = c ? V : C.y, w[L + 2] = D), T[M] = M) : S.setItemLayout(M, {
x: R,
y: V,
width: F,
height: H
}), L += 3;
}
p && S.setLayout({
largePoints: b,
largeDataIndices: T,
largeBackgroundPoints: w,
valueAxisHorizontal: c
});
}
};
}
}
};
}
function ZA(r) {
return r.coordinateSystem && r.coordinateSystem.type === "cartesian2d";
}
function XA(r) {
return r.pipelineContext && r.pipelineContext.large;
}
function YB(r, e) {
var t = e.model.get("startValue");
return t || (t = 0), e.toGlobalCoord(e.dataToCoord(e.type === "log" ? t > 0 ? t : 1 : t));
}
var ZB = function(r, e, t, n) {
for (; t < n; ) {
var a = t + n >>> 1;
r[a][1] < e ? t = a + 1 : n = a;
}
return t;
}, Yy = (
/** @class */
function(r) {
O(e, r);
function e(t) {
var n = r.call(this, t) || this;
return n.type = "time", n;
}
return e.prototype.getLabel = function(t) {
var n = this.getSetting("useUTC");
return Kf(t.value, P_[TN(xo(this._minLevelUnit))] || P_.second, n, this.getSetting("locale"));
}, e.prototype.getFormattedLabel = function(t, n, a) {
var i = this.getSetting("useUTC"), o = this.getSetting("locale");
return CN(t, n, a, o, i);
}, e.prototype.getTicks = function() {
var t = this._interval, n = this._extent, a = [];
if (!t)
return a;
a.push({
value: n[0],
level: 0
});
var i = this.getSetting("useUTC"), o = tz(this._minLevelUnit, this._approxInterval, i, n);
return a = a.concat(o), a.push({
value: n[1],
level: 0
}), a;
}, e.prototype.calcNiceExtent = function(t) {
var n = this._extent;
if (n[0] === n[1] && (n[0] -= gr, n[1] += gr), n[1] === -1 / 0 && n[0] === 1 / 0) {
var a = /* @__PURE__ */ new Date();
n[1] = +new Date(a.getFullYear(), a.getMonth(), a.getDate()), n[0] = n[1] - gr;
}
this.calcNiceTicks(t.splitNumber, t.minInterval, t.maxInterval);
}, e.prototype.calcNiceTicks = function(t, n, a) {
t = t || 10;
var i = this._extent, o = i[1] - i[0];
this._approxInterval = o / t, n != null && this._approxInterval < n && (this._approxInterval = n), a != null && this._approxInterval > a && (this._approxInterval = a);
var s = Iu.length, l = Math.min(ZB(Iu, this._approxInterval, 0, s), s - 1);
this._interval = Iu[l][1], this._minLevelUnit = Iu[Math.max(l - 1, 0)][0];
}, e.prototype.parse = function(t) {
return Tt(t) ? t : +on(t);
}, e.prototype.contain = function(t) {
return oc(this.parse(t), this._extent);
}, e.prototype.normalize = function(t) {
return sc(this.parse(t), this._extent);
}, e.prototype.scale = function(t) {
return lc(t, this._extent);
}, e.type = "time", e;
}(En)
), Iu = [
// Format interval
["second", Cy],
["minute", Dy],
["hour", Js],
["quarter-day", Js * 6],
["half-day", Js * 12],
["day", gr * 1.2],
["half-week", gr * 3.5],
["week", gr * 7],
["month", gr * 31],
["quarter", gr * 95],
["half-year", E_ / 2],
["year", E_]
// 1Y
];
function XB(r, e, t, n) {
var a = on(e), i = on(t), o = function(p) {
return k_(a, p, n) === k_(i, p, n);
}, s = function() {
return o("year");
}, l = function() {
return s() && o("month");
}, u = function() {
return l() && o("day");
}, h = function() {
return u() && o("hour");
}, f = function() {
return h() && o("minute");
}, c = function() {
return f() && o("second");
}, v = function() {
return c() && o("millisecond");
};
switch (r) {
case "year":
return s();
case "month":
return l();
case "day":
return u();
case "hour":
return h();
case "minute":
return f();
case "second":
return c();
case "millisecond":
return v();
}
}
function qB(r, e) {
return r /= gr, r > 16 ? 16 : r > 7.5 ? 7 : r > 3.5 ? 4 : r > 1.5 ? 2 : 1;
}
function KB(r) {
var e = 30 * gr;
return r /= e, r > 6 ? 6 : r > 3 ? 3 : r > 2 ? 2 : 1;
}
function jB(r) {
return r /= Js, r > 12 ? 12 : r > 6 ? 6 : r > 3.5 ? 4 : r > 2 ? 2 : 1;
}
function W1(r, e) {
return r /= e ? Dy : Cy, r > 30 ? 30 : r > 20 ? 20 : r > 15 ? 15 : r > 10 ? 10 : r > 5 ? 5 : r > 2 ? 2 : 1;
}
function QB(r) {
return dC(r);
}
function JB(r, e, t) {
var n = new Date(r);
switch (xo(e)) {
case "year":
case "month":
n[pD(t)](0);
case "day":
n[dD(t)](1);
case "hour":
n[gD(t)](0);
case "minute":
n[yD(t)](0);
case "second":
n[mD(t)](0), n[_D(t)](0);
}
return n.getTime();
}
function tz(r, e, t, n) {
var a = 1e4, i = cD, o = 0;
function s(D, M, I, L, E, P, k) {
for (var N = new Date(M), R = M, V = N[L](); R < I && R <= n[1]; )
k.push({
value: R
}), V += D, N[E](V), R = N.getTime();
k.push({
value: R,
notAdd: !0
});
}
function l(D, M, I) {
var L = [], E = !M.length;
if (!XB(xo(D), n[0], n[1], t)) {
E && (M = [{
// TODO Optimize. Not include so may ticks.
value: JB(new Date(n[0]), D, t)
}, {
value: n[1]
}]);
for (var P = 0; P < M.length - 1; P++) {
var k = M[P].value, N = M[P + 1].value;
if (k !== N) {
var R = void 0, V = void 0, F = void 0, H = !1;
switch (D) {
case "year":
R = Math.max(1, Math.round(e / gr / 365)), V = Ay(t), F = DN(t);
break;
case "half-year":
case "quarter":
case "month":
R = KB(e), V = bo(t), F = pD(t);
break;
case "week":
// PENDING If week is added. Ignore day.
case "half-week":
case "day":
R = qB(e), V = jf(t), F = dD(t), H = !0;
break;
case "half-day":
case "quarter-day":
case "hour":
R = jB(e), V = vl(t), F = gD(t);
break;
case "minute":
R = W1(e, !0), V = Qf(t), F = yD(t);
break;
case "second":
R = W1(e, !1), V = Jf(t), F = mD(t);
break;
case "millisecond":
R = QB(e), V = tc(t), F = _D(t);
break;
}
s(R, k, N, V, F, H, L), D === "year" && I.length > 1 && P === 0 && I.unshift({
value: I[0].value - R
});
}
}
for (var P = 0; P < L.length; P++)
I.push(L[P]);
return L;
}
}
for (var u = [], h = [], f = 0, c = 0, v = 0; v < i.length && o++ < a; ++v) {
var p = xo(i[v]);
if (wN(i[v])) {
l(i[v], u[u.length - 1] || [], h);
var d = i[v + 1] ? xo(i[v + 1]) : null;
if (p !== d) {
if (h.length) {
c = f, h.sort(function(D, M) {
return D.value - M.value;
});
for (var g = [], y = 0; y < h.length; ++y) {
var m = h[y].value;
(y === 0 || h[y - 1].value !== m) && (g.push(h[y]), m >= n[0] && m <= n[1] && f++);
}
var _ = (n[1] - n[0]) / e;
if (f > _ * 1.5 && c > _ / 1.5 || (u.push(g), f > _ || r === i[v]))
break;
}
h = [];
}
}
}
process.env.NODE_ENV !== "production" && o >= a && Zt("Exceed safe limit.");
for (var S = At(G(u, function(D) {
return At(D, function(M) {
return M.value >= n[0] && M.value <= n[1] && !M.notAdd;
});
}), function(D) {
return D.length > 0;
}), x = [], b = S.length - 1, v = 0; v < S.length; ++v)
for (var w = S[v], T = 0; T < w.length; ++T)
x.push({
value: w[T].value,
level: b - v
});
x.sort(function(D, M) {
return D.value - M.value;
});
for (var C = [], v = 0; v < x.length; ++v)
(v === 0 || x[v].value !== x[v - 1].value) && C.push(x[v]);
return C;
}
hn.registerClass(Yy);
var $1 = hn.prototype, nl = En.prototype, ez = jt, rz = Math.floor, nz = Math.ceil, Lu = Math.pow, Tr = Math.log, Zy = (
/** @class */
function(r) {
O(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t.type = "log", t.base = 10, t._originalScale = new En(), t._interval = 0, t;
}
return e.prototype.getTicks = function(t) {
var n = this._originalScale, a = this._extent, i = n.getExtent(), o = nl.getTicks.call(this, t);
return G(o, function(s) {
var l = s.value, u = jt(Lu(this.base, l));
return u = l === a[0] && this._fixMin ? Eu(u, i[0]) : u, u = l === a[1] && this._fixMax ? Eu(u, i[1]) : u, {
value: u
};
}, this);
}, e.prototype.setExtent = function(t, n) {
var a = Tr(this.base);
t = Tr(Math.max(0, t)) / a, n = Tr(Math.max(0, n)) / a, nl.setExtent.call(this, t, n);
}, e.prototype.getExtent = function() {
var t = this.base, n = $1.getExtent.call(this);
n[0] = Lu(t, n[0]), n[1] = Lu(t, n[1]);
var a = this._originalScale, i = a.getExtent();
return this._fixMin && (n[0] = Eu(n[0], i[0])), this._fixMax && (n[1] = Eu(n[1], i[1])), n;
}, e.prototype.unionExtent = function(t) {
this._originalScale.unionExtent(t);
var n = this.base;
t[0] = Tr(t[0]) / Tr(n), t[1] = Tr(t[1]) / Tr(n), $1.unionExtent.call(this, t);
}, e.prototype.unionExtentFromData = function(t, n) {
this.unionExtent(t.getApproximateExtent(n));
}, e.prototype.calcNiceTicks = function(t) {
t = t || 10;
var n = this._extent, a = n[1] - n[0];
if (!(a === 1 / 0 || a <= 0)) {
var i = tk(a), o = t / a * i;
for (o <= 0.5 && (i *= 10); !isNaN(i) && Math.abs(i) < 1 && Math.abs(i) > 0; )
i *= 10;
var s = [jt(nz(n[0] / i) * i), jt(rz(n[1] / i) * i)];
this._interval = i, this._niceExtent = s;
}
}, e.prototype.calcNiceExtent = function(t) {
nl.calcNiceExtent.call(this, t), this._fixMin = t.fixMin, this._fixMax = t.fixMax;
}, e.prototype.parse = function(t) {
return t;
}, e.prototype.contain = function(t) {
return t = Tr(t) / Tr(this.base), oc(t, this._extent);
}, e.prototype.normalize = function(t) {
return t = Tr(t) / Tr(this.base), sc(t, this._extent);
}, e.prototype.scale = function(t) {
return t = lc(t, this._extent), Lu(this.base, t);
}, e.type = "log", e;
}(hn)
), qA = Zy.prototype;
qA.getMinorTicks = nl.getMinorTicks;
qA.getLabel = nl.getLabel;
function Eu(r, e) {
return ez(r, Kr(e));
}
hn.registerClass(Zy);
var az = (
/** @class */
function() {
function r(e, t, n) {
this._prepareParams(e, t, n);
}
return r.prototype._prepareParams = function(e, t, n) {
n[1] < n[0] && (n = [NaN, NaN]), this._dataMin = n[0], this._dataMax = n[1];
var a = this._isOrdinal = e.type === "ordinal";
this._needCrossZero = e.type === "interval" && t.getNeedCrossZero && t.getNeedCrossZero();
var i = t.get("min", !0);
i == null && (i = t.get("startValue", !0));
var o = this._modelMinRaw = i;
K(o) ? this._modelMinNum = Pu(e, o({
min: n[0],
max: n[1]
})) : o !== "dataMin" && (this._modelMinNum = Pu(e, o));
var s = this._modelMaxRaw = t.get("max", !0);
if (K(s) ? this._modelMaxNum = Pu(e, s({
min: n[0],
max: n[1]
})) : s !== "dataMax" && (this._modelMaxNum = Pu(e, s)), a)
this._axisDataLen = t.getCategories().length;
else {
var l = t.get("boundaryGap"), u = z(l) ? l : [l || 0, l || 0];
typeof u[0] == "boolean" || typeof u[1] == "boolean" ? (process.env.NODE_ENV !== "production" && console.warn('Boolean type for boundaryGap is only allowed for ordinal axis. Please use string in percentage instead, e.g., "20%". Currently, boundaryGap is set to be 0.'), this._boundaryGapInner = [0, 0]) : this._boundaryGapInner = [Rr(u[0], 1), Rr(u[1], 1)];
}
}, r.prototype.calculate = function() {
var e = this._isOrdinal, t = this._dataMin, n = this._dataMax, a = this._axisDataLen, i = this._boundaryGapInner, o = e ? null : n - t || Math.abs(t), s = this._modelMinRaw === "dataMin" ? t : this._modelMinNum, l = this._modelMaxRaw === "dataMax" ? n : this._modelMaxNum, u = s != null, h = l != null;
s == null && (s = e ? a ? 0 : NaN : t - i[0] * o), l == null && (l = e ? a ? a - 1 : NaN : n + i[1] * o), (s == null || !isFinite(s)) && (s = NaN), (l == null || !isFinite(l)) && (l = NaN);
var f = Si(s) || Si(l) || e && !a;
this._needCrossZero && (s > 0 && l > 0 && !u && (s = 0), s < 0 && l < 0 && !h && (l = 0));
var c = this._determinedMin, v = this._determinedMax;
return c != null && (s = c, u = !0), v != null && (l = v, h = !0), {
min: s,
max: l,
minFixed: u,
maxFixed: h,
isBlank: f
};
}, r.prototype.modifyDataMinMax = function(e, t) {
process.env.NODE_ENV !== "production" && tt(!this.frozen), this[oz[e]] = t;
}, r.prototype.setDeterminedMinMax = function(e, t) {
var n = iz[e];
process.env.NODE_ENV !== "production" && tt(!this.frozen && this[n] == null), this[n] = t;
}, r.prototype.freeze = function() {
this.frozen = !0;
}, r;
}()
), iz = {
min: "_determinedMin",
max: "_determinedMax"
}, oz = {
min: "_dataMin",
max: "_dataMax"
};
function KA(r, e, t) {
var n = r.rawExtentInfo;
return n || (n = new az(r, e, t), r.rawExtentInfo = n, n);
}
function Pu(r, e) {
return e == null ? null : Si(e) ? NaN : r.parse(e);
}
function jA(r, e) {
var t = r.type, n = KA(r, e, r.getExtent()).calculate();
r.setBlank(n.isBlank);
var a = n.min, i = n.max, o = e.ecModel;
if (o && t === "time") {
var s = HA("bar", o), l = !1;
if (A(s, function(f) {
l = l || f.getBaseAxis() === e.axis;
}), l) {
var u = WA(s), h = sz(a, i, e, u);
a = h.min, i = h.max;
}
}
return {
extent: [a, i],
// "fix" means "fixed", the value should not be
// changed in the subsequent steps.
fixMin: n.minFixed,
fixMax: n.maxFixed
};
}
function sz(r, e, t, n) {
var a = t.axis.getExtent(), i = Math.abs(a[1] - a[0]), o = UB(n, t.axis);
if (o === void 0)
return {
min: r,
max: e
};
var s = 1 / 0;
A(o, function(v) {
s = Math.min(v.offset, s);
});
var l = -1 / 0;
A(o, function(v) {
l = Math.max(v.offset + v.width, l);
}), s = Math.abs(s), l = Math.abs(l);
var u = s + l, h = e - r, f = 1 - (s + l) / i, c = h / f - h;
return e += c * (l / u), r -= c * (s / u), {
min: r,
max: e
};
}
function Io(r, e) {
var t = e, n = jA(r, t), a = n.extent, i = t.get("splitNumber");
r instanceof Zy && (r.base = t.get("logBase"));
var o = r.type, s = t.get("interval"), l = o === "interval" || o === "time";
r.setExtent(a[0], a[1]), r.calcNiceExtent({
splitNumber: i,
fixMin: n.fixMin,
fixMax: n.fixMax,
minInterval: l ? t.get("minInterval") : null,
maxInterval: l ? t.get("maxInterval") : null
}), s != null && r.setInterval && r.setInterval(s);
}
function hc(r, e) {
if (e = e || r.get("type"), e)
switch (e) {
// Buildin scale
case "category":
return new uc({
ordinalMeta: r.getOrdinalMeta ? r.getOrdinalMeta() : r.getCategories(),
extent: [1 / 0, -1 / 0]
});
case "time":
return new Yy({
locale: r.ecModel.getLocaleModel(),
useUTC: r.ecModel.get("useUTC")
});
default:
return new (hn.getClass(e) || En)();
}
}
function lz(r) {
var e = r.scale.getExtent(), t = e[0], n = e[1];
return !(t > 0 && n > 0 || t < 0 && n < 0);
}
function Ko(r) {
var e = r.getLabelModel().get("formatter"), t = r.type === "category" ? r.scale.getExtent()[0] : null;
return r.scale.type === "time" ? /* @__PURE__ */ function(n) {
return function(a, i) {
return r.scale.getFormattedLabel(a, i, n);
};
}(e) : U(e) ? /* @__PURE__ */ function(n) {
return function(a) {
var i = r.scale.getLabel(a), o = n.replace("{value}", i ?? "");
return o;
};
}(e) : K(e) ? /* @__PURE__ */ function(n) {
return function(a, i) {
return t != null && (i = a.value - t), n(Xy(r, a), i, a.level != null ? {
level: a.level
} : null);
};
}(e) : function(n) {
return r.scale.getLabel(n);
};
}
function Xy(r, e) {
return r.type === "category" ? r.scale.getLabel(e) : e.value;
}
function uz(r) {
var e = r.model, t = r.scale;
if (!(!e.get(["axisLabel", "show"]) || t.isBlank())) {
var n, a, i = t.getExtent();
t instanceof uc ? a = t.count() : (n = t.getTicks(), a = n.length);
var o = r.getLabelModel(), s = Ko(r), l, u = 1;
a > 40 && (u = Math.ceil(a / 40));
for (var h = 0; h < a; h += u) {
var f = n ? n[h] : {
value: i[0] + h
}, c = s(f, h), v = o.getTextRect(c), p = hz(v, o.get("rotate") || 0);
l ? l.union(p) : l = p;
}
return l;
}
}
function hz(r, e) {
var t = e * Math.PI / 180, n = r.width, a = r.height, i = n * Math.abs(Math.cos(t)) + Math.abs(a * Math.sin(t)), o = n * Math.abs(Math.sin(t)) + Math.abs(a * Math.cos(t)), s = new ct(r.x, r.y, i, o);
return s;
}
function qy(r) {
var e = r.get("interval");
return e ?? "auto";
}
function QA(r) {
return r.type === "category" && qy(r.getLabelModel()) === 0;
}
function ef(r, e) {
var t = {};
return A(r.mapDimensionsAll(e), function(n) {
t[BA(r, n)] = !0;
}), St(t);
}
function fz(r, e, t) {
e && A(ef(e, t), function(n) {
var a = e.getApproximateExtent(n);
a[0] < r[0] && (r[0] = a[0]), a[1] > r[1] && (r[1] = a[1]);
});
}
var Ul = (
/** @class */
function() {
function r() {
}
return r.prototype.getNeedCrossZero = function() {
var e = this.option;
return !e.scale;
}, r.prototype.getCoordSysModel = function() {
}, r;
}()
), cz = 1e-8;
function U1(r, e) {
return Math.abs(r - e) < cz;
}
function ja(r, e, t) {
var n = 0, a = r[0];
if (!a)
return !1;
for (var i = 1; i < r.length; i++) {
var o = r[i];
n += dn(a[0], a[1], o[0], o[1], e, t), a = o;
}
var s = r[0];
return (!U1(a[0], s[0]) || !U1(a[1], s[1])) && (n += dn(a[0], a[1], s[0], s[1], e, t)), n !== 0;
}
var vz = [];
function Av(r, e) {
for (var t = 0; t < r.length; t++)
me(r[t], r[t], e);
}
function Y1(r, e, t, n) {
for (var a = 0; a < r.length; a++) {
var i = r[a];
n && (i = n.project(i)), i && isFinite(i[0]) && isFinite(i[1]) && (Qn(e, e, i), Jn(t, t, i));
}
}
function pz(r) {
for (var e = 0, t = 0, n = 0, a = r.length, i = r[a - 1][0], o = r[a - 1][1], s = 0; s < a; s++) {
var l = r[s][0], u = r[s][1], h = i * u - l * o;
e += h, t += (i + l) * h, n += (o + u) * h, i = l, o = u;
}
return e ? [t / e / 3, n / e / 3, e] : [r[0][0] || 0, r[0][1] || 0];
}
var JA = (
/** @class */
function() {
function r(e) {
this.name = e;
}
return r.prototype.setCenter = function(e) {
this._center = e;
}, r.prototype.getCenter = function() {
var e = this._center;
return e || (e = this._center = this.calcCenter()), e;
}, r;
}()
), Z1 = (
/** @class */
/* @__PURE__ */ function() {
function r(e, t) {
this.type = "polygon", this.exterior = e, this.interiors = t;
}
return r;
}()
), X1 = (
/** @class */
/* @__PURE__ */ function() {
function r(e) {
this.type = "linestring", this.points = e;
}
return r;
}()
), tM = (
/** @class */
function(r) {
O(e, r);
function e(t, n, a) {
var i = r.call(this, t) || this;
return i.type = "geoJSON", i.geometries = n, i._center = a && [a[0], a[1]], i;
}
return e.prototype.calcCenter = function() {
for (var t = this.geometries, n, a = 0, i = 0; i < t.length; i++) {
var o = t[i], s = o.exterior, l = s && s.length;
l > a && (n = o, a = l);
}
if (n)
return pz(n.exterior);
var u = this.getBoundingRect();
return [u.x + u.width / 2, u.y + u.height / 2];
}, e.prototype.getBoundingRect = function(t) {
var n = this._rect;
if (n && !t)
return n;
var a = [1 / 0, 1 / 0], i = [-1 / 0, -1 / 0], o = this.geometries;
return A(o, function(s) {
s.type === "polygon" ? Y1(s.exterior, a, i, t) : A(s.points, function(l) {
Y1(l, a, i, t);
});
}), isFinite(a[0]) && isFinite(a[1]) && isFinite(i[0]) && isFinite(i[1]) || (a[0] = a[1] = i[0] = i[1] = 0), n = new ct(a[0], a[1], i[0] - a[0], i[1] - a[1]), t || (this._rect = n), n;
}, e.prototype.contain = function(t) {
var n = this.getBoundingRect(), a = this.geometries;
if (!n.contain(t[0], t[1]))
return !1;
t: for (var i = 0, o = a.length; i < o; i++) {
var s = a[i];
if (s.type === "polygon") {
var l = s.exterior, u = s.interiors;
if (ja(l, t[0], t[1])) {
for (var h = 0; h < (u ? u.length : 0); h++)
if (ja(u[h], t[0], t[1]))
continue t;
return !0;
}
}
}
return !1;
}, e.prototype.transformTo = function(t, n, a, i) {
var o = this.getBoundingRect(), s = o.width / o.height;
a ? i || (i = a / s) : a = s * i;
for (var l = new ct(t, n, a, i), u = o.calculateTransform(l), h = this.geometries, f = 0; f < h.length; f++) {
var c = h[f];
c.type === "polygon" ? (Av(c.exterior, u), A(c.interiors, function(v) {
Av(v, u);
})) : A(c.points, function(v) {
Av(v, u);
});
}
o = this._rect, o.copy(l), this._center = [o.x + o.width / 2, o.y + o.height / 2];
}, e.prototype.cloneShallow = function(t) {
t == null && (t = this.name);
var n = new e(t, this.geometries, this._center);
return n._rect = this._rect, n.transformTo = null, n;
}, e;
}(JA)
), dz = (
/** @class */
function(r) {
O(e, r);
function e(t, n) {
var a = r.call(this, t) || this;
return a.type = "geoSVG", a._elOnlyForCalculate = n, a;
}
return e.prototype.calcCenter = function() {
for (var t = this._elOnlyForCalculate, n = t.getBoundingRect(), a = [n.x + n.width / 2, n.y + n.height / 2], i = kf(vz), o = t; o && !o.isGeoSVGGraphicRoot; )
xn(i, o.getLocalTransform(), i), o = o.parent;
return Vo(i, i), me(a, a, i), a;
}, e;
}(JA)
);
function gz(r) {
if (!r.UTF8Encoding)
return r;
var e = r, t = e.UTF8Scale;
t == null && (t = 1024);
var n = e.features;
return A(n, function(a) {
var i = a.geometry, o = i.encodeOffsets, s = i.coordinates;
if (o)
switch (i.type) {
case "LineString":
i.coordinates = eM(s, o, t);
break;
case "Polygon":
Mv(s, o, t);
break;
case "MultiLineString":
Mv(s, o, t);
break;
case "MultiPolygon":
A(s, function(l, u) {
return Mv(l, o[u], t);
});
}
}), e.UTF8Encoding = !1, e;
}
function Mv(r, e, t) {
for (var n = 0; n < r.length; n++)
r[n] = eM(r[n], e[n], t);
}
function eM(r, e, t) {
for (var n = [], a = e[0], i = e[1], o = 0; o < r.length; o += 2) {
var s = r.charCodeAt(o) - 64, l = r.charCodeAt(o + 1) - 64;
s = s >> 1 ^ -(s & 1), l = l >> 1 ^ -(l & 1), s += a, l += i, a = s, i = l, n.push([s / t, l / t]);
}
return n;
}
function yz(r, e) {
return r = gz(r), G(At(r.features, function(t) {
return t.geometry && t.properties && t.geometry.coordinates.length > 0;
}), function(t) {
var n = t.properties, a = t.geometry, i = [];
switch (a.type) {
case "Polygon":
var o = a.coordinates;
i.push(new Z1(o[0], o.slice(1)));
break;
case "MultiPolygon":
A(a.coordinates, function(l) {
l[0] && i.push(new Z1(l[0], l.slice(1)));
});
break;
case "LineString":
i.push(new X1([a.coordinates]));
break;
case "MultiLineString":
i.push(new X1(a.coordinates));
}
var s = new tM(n[e || "name"], i, n.cp);
return s.properties = n, s;
});
}
var _l = bt();
function rM(r, e) {
var t = G(e, function(n) {
return r.scale.parse(n);
});
return r.type === "time" && t.length > 0 && (t.sort(), t.unshift(t[0]), t.push(t[t.length - 1])), t;
}
function mz(r) {
var e = r.getLabelModel().get("customValues");
if (e) {
var t = Ko(r), n = r.scale.getExtent(), a = rM(r, e), i = At(a, function(o) {
return o >= n[0] && o <= n[1];
});
return {
labels: G(i, function(o) {
var s = {
value: o
};
return {
formattedLabel: t(s),
rawLabel: r.scale.getLabel(s),
tickValue: o
};
})
};
}
return r.type === "category" ? Sz(r) : bz(r);
}
function _z(r, e) {
var t = r.getTickModel().get("customValues");
if (t) {
var n = r.scale.getExtent(), a = rM(r, t);
return {
ticks: At(a, function(i) {
return i >= n[0] && i <= n[1];
})
};
}
return r.type === "category" ? xz(r, e) : {
ticks: G(r.scale.getTicks(), function(i) {
return i.value;
})
};
}
function Sz(r) {
var e = r.getLabelModel(), t = nM(r, e);
return !e.get("show") || r.scale.isBlank() ? {
labels: [],
labelCategoryInterval: t.labelCategoryInterval
} : t;
}
function nM(r, e) {
var t = aM(r, "labels"), n = qy(e), a = iM(t, n);
if (a)
return a;
var i, o;
return K(n) ? i = lM(r, n) : (o = n === "auto" ? wz(r) : n, i = sM(r, o)), oM(t, n, {
labels: i,
labelCategoryInterval: o
});
}
function xz(r, e) {
var t = aM(r, "ticks"), n = qy(e), a = iM(t, n);
if (a)
return a;
var i, o;
if ((!e.get("show") || r.scale.isBlank()) && (i = []), K(n))
i = lM(r, n, !0);
else if (n === "auto") {
var s = nM(r, r.getLabelModel());
o = s.labelCategoryInterval, i = G(s.labels, function(l) {
return l.tickValue;
});
} else
o = n, i = sM(r, o, !0);
return oM(t, n, {
ticks: i,
tickCategoryInterval: o
});
}
function bz(r) {
var e = r.scale.getTicks(), t = Ko(r);
return {
labels: G(e, function(n, a) {
return {
level: n.level,
formattedLabel: t(n, a),
rawLabel: r.scale.getLabel(n),
tickValue: n.value
};
})
};
}
function aM(r, e) {
return _l(r)[e] || (_l(r)[e] = []);
}
function iM(r, e) {
for (var t = 0; t < r.length; t++)
if (r[t].key === e)
return r[t].value;
}
function oM(r, e, t) {
return r.push({
key: e,
value: t
}), t;
}
function wz(r) {
var e = _l(r).autoInterval;
return e ?? (_l(r).autoInterval = r.calculateCategoryInterval());
}
function Tz(r) {
var e = Cz(r), t = Ko(r), n = (e.axisRotate - e.labelRotate) / 180 * Math.PI, a = r.scale, i = a.getExtent(), o = a.count();
if (i[1] - i[0] < 1)
return 0;
var s = 1;
o > 40 && (s = Math.max(1, Math.floor(o / 40)));
for (var l = i[0], u = r.dataToCoord(l + 1) - r.dataToCoord(l), h = Math.abs(u * Math.cos(n)), f = Math.abs(u * Math.sin(n)), c = 0, v = 0; l <= i[1]; l += s) {
var p = 0, d = 0, g = Nl(t({
value: l
}), e.font, "center", "top");
p = g.width * 1.3, d = g.height * 1.3, c = Math.max(c, p, 7), v = Math.max(v, d, 7);
}
var y = c / h, m = v / f;
isNaN(y) && (y = 1 / 0), isNaN(m) && (m = 1 / 0);
var _ = Math.max(0, Math.floor(Math.min(y, m))), S = _l(r.model), x = r.getExtent(), b = S.lastAutoInterval, w = S.lastTickCount;
return b != null && w != null && Math.abs(b - _) <= 1 && Math.abs(w - o) <= 1 && b > _ && S.axisExtent0 === x[0] && S.axisExtent1 === x[1] ? _ = b : (S.lastTickCount = o, S.lastAutoInterval = _, S.axisExtent0 = x[0], S.axisExtent1 = x[1]), _;
}
function Cz(r) {
var e = r.getLabelModel();
return {
axisRotate: r.getRotate ? r.getRotate() : r.isHorizontal && !r.isHorizontal() ? 90 : 0,
labelRotate: e.get("rotate") || 0,
font: e.getFont()
};
}
function sM(r, e, t) {
var n = Ko(r), a = r.scale, i = a.getExtent(), o = r.getLabelModel(), s = [], l = Math.max((e || 0) + 1, 1), u = i[0], h = a.count();
u !== 0 && l > 1 && h / l > 2 && (u = Math.round(Math.ceil(u / l) * l));
var f = QA(r), c = o.get("showMinLabel") || f, v = o.get("showMaxLabel") || f;
c && u !== i[0] && d(i[0]);
for (var p = u; p <= i[1]; p += l)
d(p);
v && p - l !== i[1] && d(i[1]);
function d(g) {
var y = {
value: g
};
s.push(t ? g : {
formattedLabel: n(y),
rawLabel: a.getLabel(y),
tickValue: g
});
}
return s;
}
function lM(r, e, t) {
var n = r.scale, a = Ko(r), i = [];
return A(n.getTicks(), function(o) {
var s = n.getLabel(o), l = o.value;
e(o.value, s) && i.push(t ? l : {
formattedLabel: a(o),
rawLabel: s,
tickValue: l
});
}), i;
}
var q1 = [0, 1], Br = (
/** @class */
function() {
function r(e, t, n) {
this.onBand = !1, this.inverse = !1, this.dim = e, this.scale = t, this._extent = n || [0, 0];
}
return r.prototype.contain = function(e) {
var t = this._extent, n = Math.min(t[0], t[1]), a = Math.max(t[0], t[1]);
return e >= n && e <= a;
}, r.prototype.containData = function(e) {
return this.scale.contain(e);
}, r.prototype.getExtent = function() {
return this._extent.slice();
}, r.prototype.getPixelPrecision = function(e) {
return vC(e || this.scale.getExtent(), this._extent);
}, r.prototype.setExtent = function(e, t) {
var n = this._extent;
n[0] = e, n[1] = t;
}, r.prototype.dataToCoord = function(e, t) {
var n = this._extent, a = this.scale;
return e = a.normalize(e), this.onBand && a.type === "ordinal" && (n = n.slice(), K1(n, a.count())), Mt(e, q1, n, t);
}, r.prototype.coordToData = function(e, t) {
var n = this._extent, a = this.scale;
this.onBand && a.type === "ordinal" && (n = n.slice(), K1(n, a.count()));
var i = Mt(e, n, q1, t);
return this.scale.scale(i);
}, r.prototype.pointToData = function(e, t) {
}, r.prototype.getTicksCoords = function(e) {
e = e || {};
var t = e.tickModel || this.getTickModel(), n = _z(this, t), a = n.ticks, i = G(a, function(s) {
return {
coord: this.dataToCoord(this.scale.type === "ordinal" ? this.scale.getRawOrdinalNumber(s) : s),
tickValue: s
};
}, this), o = t.get("alignWithLabel");
return Dz(this, i, o, e.clamp), i;
}, r.prototype.getMinorTicksCoords = function() {
if (this.scale.type === "ordinal")
return [];
var e = this.model.getModel("minorTick"), t = e.get("splitNumber");
t > 0 && t < 100 || (t = 5);
var n = this.scale.getMinorTicks(t), a = G(n, function(i) {
return G(i, function(o) {
return {
coord: this.dataToCoord(o),
tickValue: o
};
}, this);
}, this);
return a;
}, r.prototype.getViewLabels = function() {
return mz(this).labels;
}, r.prototype.getLabelModel = function() {
return this.model.getModel("axisLabel");
}, r.prototype.getTickModel = function() {
return this.model.getModel("axisTick");
}, r.prototype.getBandWidth = function() {
var e = this._extent, t = this.scale.getExtent(), n = t[1] - t[0] + (this.onBand ? 1 : 0);
n === 0 && (n = 1);
var a = Math.abs(e[1] - e[0]);
return Math.abs(a) / n;
}, r.prototype.calculateCategoryInterval = function() {
return Tz(this);
}, r;
}()
);
function K1(r, e) {
var t = r[1] - r[0], n = e, a = t / n / 2;
r[0] += a, r[1] -= a;
}
function Dz(r, e, t, n) {
var a = e.length;
if (!r.onBand || t || !a)
return;
var i = r.getExtent(), o, s;
if (a === 1)
e[0].coord = i[0], o = e[1] = {
coord: i[1],
tickValue: e[0].tickValue
};
else {
var l = e[a - 1].tickValue - e[0].tickValue, u = (e[a - 1].coord - e[0].coord) / l;
A(e, function(v) {
v.coord -= u / 2;
});
var h = r.scale.getExtent();
s = 1 + h[1] - e[a - 1].tickValue, o = {
coord: e[a - 1].coord + u * s,
tickValue: h[1] + 1
}, e.push(o);
}
var f = i[0] > i[1];
c(e[0].coord, i[0]) && (n ? e[0].coord = i[0] : e.shift()), n && c(i[0], e[0].coord) && e.unshift({
coord: i[0]
}), c(i[1], o.coord) && (n ? o.coord = i[1] : e.pop()), n && c(o.coord, i[1]) && e.push({
coord: i[1]
});
function c(v, p) {
return v = jt(v), p = jt(p), f ? v > p : v < p;
}
}
var _s = Math.PI * 2, Fa = sn.CMD, Az = ["top", "right", "bottom", "left"];
function Mz(r, e, t, n, a) {
var i = t.width, o = t.height;
switch (r) {
case "top":
n.set(t.x + i / 2, t.y - e), a.set(0, -1);
break;
case "bottom":
n.set(t.x + i / 2, t.y + o + e), a.set(0, 1);
break;
case "left":
n.set(t.x - e, t.y + o / 2), a.set(-1, 0);
break;
case "right":
n.set(t.x + i + e, t.y + o / 2), a.set(1, 0);
break;
}
}
function Iz(r, e, t, n, a, i, o, s, l) {
o -= r, s -= e;
var u = Math.sqrt(o * o + s * s);
o /= u, s /= u;
var h = o * t + r, f = s * t + e;
if (Math.abs(n - a) % _s < 1e-4)
return l[0] = h, l[1] = f, u - t;
if (i) {
var c = n;
n = Je(a), a = Je(c);
} else
n = Je(n), a = Je(a);
n > a && (a += _s);
var v = Math.atan2(s, o);
if (v < 0 && (v += _s), v >= n && v <= a || v + _s >= n && v + _s <= a)
return l[0] = h, l[1] = f, u - t;
var p = t * Math.cos(n) + r, d = t * Math.sin(n) + e, g = t * Math.cos(a) + r, y = t * Math.sin(a) + e, m = (p - o) * (p - o) + (d - s) * (d - s), _ = (g - o) * (g - o) + (y - s) * (y - s);
return m < _ ? (l[0] = p, l[1] = d, Math.sqrt(m)) : (l[0] = g, l[1] = y, Math.sqrt(_));
}
function rf(r, e, t, n, a, i, o, s) {
var l = a - r, u = i - e, h = t - r, f = n - e, c = Math.sqrt(h * h + f * f);
h /= c, f /= c;
var v = l * h + u * f, p = v / c;
s && (p = Math.min(Math.max(p, 0), 1)), p *= c;
var d = o[0] = r + p * h, g = o[1] = e + p * f;
return Math.sqrt((d - a) * (d - a) + (g - i) * (g - i));
}
function uM(r, e, t, n, a, i, o) {
t < 0 && (r = r + t, t = -t), n < 0 && (e = e + n, n = -n);
var s = r + t, l = e + n, u = o[0] = Math.min(Math.max(a, r), s), h = o[1] = Math.min(Math.max(i, e), l);
return Math.sqrt((u - a) * (u - a) + (h - i) * (h - i));
}
var Mr = [];
function Lz(r, e, t) {
var n = uM(e.x, e.y, e.width, e.height, r.x, r.y, Mr);
return t.set(Mr[0], Mr[1]), n;
}
function Ez(r, e, t) {
for (var n = 0, a = 0, i = 0, o = 0, s, l, u = 1 / 0, h = e.data, f = r.x, c = r.y, v = 0; v < h.length; ) {
var p = h[v++];
v === 1 && (n = h[v], a = h[v + 1], i = n, o = a);
var d = u;
switch (p) {
case Fa.M:
i = h[v++], o = h[v++], n = i, a = o;
break;
case Fa.L:
d = rf(n, a, h[v], h[v + 1], f, c, Mr, !0), n = h[v++], a = h[v++];
break;
case Fa.C:
d = qT(n, a, h[v++], h[v++], h[v++], h[v++], h[v], h[v + 1], f, c, Mr), n = h[v++], a = h[v++];
break;
case Fa.Q:
d = jT(n, a, h[v++], h[v++], h[v], h[v + 1], f, c, Mr), n = h[v++], a = h[v++];
break;
case Fa.A:
var g = h[v++], y = h[v++], m = h[v++], _ = h[v++], S = h[v++], x = h[v++];
v += 1;
var b = !!(1 - h[v++]);
s = Math.cos(S) * m + g, l = Math.sin(S) * _ + y, v <= 1 && (i = s, o = l);
var w = (f - g) * _ / m + g;
d = Iz(g, y, _, S, S + x, b, w, c, Mr), n = Math.cos(S + x) * m + g, a = Math.sin(S + x) * _ + y;
break;
case Fa.R:
i = n = h[v++], o = a = h[v++];
var T = h[v++], C = h[v++];
d = uM(i, o, T, C, f, c, Mr);
break;
case Fa.Z:
d = rf(n, a, i, o, f, c, Mr, !0), n = i, a = o;
break;
}
d < u && (u = d, t.set(Mr[0], Mr[1]));
}
return u;
}
var Lr = new ft(), Bt = new ft(), Qt = new ft(), Jr = new ft(), qr = new ft();
function j1(r, e) {
if (r) {
var t = r.getTextGuideLine(), n = r.getTextContent();
if (n && t) {
var a = r.textGuideLineConfig || {}, i = [[0, 0], [0, 0], [0, 0]], o = a.candidates || Az, s = n.getBoundingRect().clone();
s.applyTransform(n.getComputedTransform());
var l = 1 / 0, u = a.anchor, h = r.getComputedTransform(), f = h && Vo([], h), c = e.get("length2") || 0;
u && Qt.copy(u);
for (var v = 0; v < o.length; v++) {
var p = o[v];
Mz(p, 0, s, Lr, Jr), ft.scaleAndAdd(Bt, Lr, Jr, c), Bt.transform(f);
var d = r.getBoundingRect(), g = u ? u.distance(Bt) : r instanceof mt ? Ez(Bt, r.path, Qt) : Lz(Bt, d, Qt);
g < l && (l = g, Bt.transform(h), Qt.transform(h), Qt.toArray(i[0]), Bt.toArray(i[1]), Lr.toArray(i[2]));
}
hM(i, e.get("minTurnAngle")), t.setShape({
points: i
});
}
}
}
var nf = [], Pe = new ft();
function hM(r, e) {
if (e <= 180 && e > 0) {
e = e / 180 * Math.PI, Lr.fromArray(r[0]), Bt.fromArray(r[1]), Qt.fromArray(r[2]), ft.sub(Jr, Lr, Bt), ft.sub(qr, Qt, Bt);
var t = Jr.len(), n = qr.len();
if (!(t < 1e-3 || n < 1e-3)) {
Jr.scale(1 / t), qr.scale(1 / n);
var a = Jr.dot(qr), i = Math.cos(e);
if (i < a) {
var o = rf(Bt.x, Bt.y, Qt.x, Qt.y, Lr.x, Lr.y, nf, !1);
Pe.fromArray(nf), Pe.scaleAndAdd(qr, o / Math.tan(Math.PI - e));
var s = Qt.x !== Bt.x ? (Pe.x - Bt.x) / (Qt.x - Bt.x) : (Pe.y - Bt.y) / (Qt.y - Bt.y);
if (isNaN(s))
return;
s < 0 ? ft.copy(Pe, Bt) : s > 1 && ft.copy(Pe, Qt), Pe.toArray(r[1]);
}
}
}
}
function Pz(r, e, t) {
if (t <= 180 && t > 0) {
t = t / 180 * Math.PI, Lr.fromArray(r[0]), Bt.fromArray(r[1]), Qt.fromArray(r[2]), ft.sub(Jr, Bt, Lr), ft.sub(qr, Qt, Bt);
var n = Jr.len(), a = qr.len();
if (!(n < 1e-3 || a < 1e-3)) {
Jr.scale(1 / n), qr.scale(1 / a);
var i = Jr.dot(e), o = Math.cos(t);
if (i < o) {
var s = rf(Bt.x, Bt.y, Qt.x, Qt.y, Lr.x, Lr.y, nf, !1);
Pe.fromArray(nf);
var l = Math.PI / 2, u = Math.acos(qr.dot(e)), h = l + u - t;
if (h >= l)
ft.copy(Pe, Qt);
else {
Pe.scaleAndAdd(qr, s / Math.tan(Math.PI / 2 - h));
var f = Qt.x !== Bt.x ? (Pe.x - Bt.x) / (Qt.x - Bt.x) : (Pe.y - Bt.y) / (Qt.y - Bt.y);
if (isNaN(f))
return;
f < 0 ? ft.copy(Pe, Bt) : f > 1 && ft.copy(Pe, Qt);
}
Pe.toArray(r[1]);
}
}
}
}
function Iv(r, e, t, n) {
var a = t === "normal", i = a ? r : r.ensureState(t);
i.ignore = e;
var o = n.get("smooth");
o && o === !0 && (o = 0.3), i.shape = i.shape || {}, o > 0 && (i.shape.smooth = o);
var s = n.getModel("lineStyle").getLineStyle();
a ? r.useStyle(s) : i.style = s;
}
function kz(r, e) {
var t = e.smooth, n = e.points;
if (n)
if (r.moveTo(n[0][0], n[0][1]), t > 0 && n.length >= 3) {
var a = jn(n[0], n[1]), i = jn(n[1], n[2]);
if (!a || !i) {
r.lineTo(n[1][0], n[1][1]), r.lineTo(n[2][0], n[2][1]);
return;
}
var o = Math.min(a, i) * t, s = oh([], n[1], n[0], o / a), l = oh([], n[1], n[2], o / i), u = oh([], s, l, 0.5);
r.bezierCurveTo(s[0], s[1], s[0], s[1], u[0], u[1]), r.bezierCurveTo(l[0], l[1], l[0], l[1], n[2][0], n[2][1]);
} else
for (var h = 1; h < n.length; h++)
r.lineTo(n[h][0], n[h][1]);
}
function Ky(r, e, t) {
var n = r.getTextGuideLine(), a = r.getTextContent();
if (!a) {
n && r.removeTextGuideLine();
return;
}
for (var i = e.normal, o = i.get("show"), s = a.ignore, l = 0; l < fl.length; l++) {
var u = fl[l], h = e[u], f = u === "normal";
if (h) {
var c = h.get("show"), v = f ? s : ot(a.states[u] && a.states[u].ignore, s);
if (v || !ot(c, o)) {
var p = f ? n : n && n.states[u];
p && (p.ignore = !0), n && Iv(n, !0, u, h);
continue;
}
n || (n = new He(), r.setTextGuideLine(n), !f && (s || !o) && Iv(n, !0, "normal", e.normal), r.stateProxy && (n.stateProxy = r.stateProxy)), Iv(n, !1, u, h);
}
}
if (n) {
et(n.style, t), n.style.fill = null;
var d = i.get("showAbove"), g = r.textGuideLineConfig = r.textGuideLineConfig || {};
g.showAbove = d || !1, n.buildPath = kz;
}
}
function jy(r, e) {
e = e || "labelLine";
for (var t = {
normal: r.getModel(e)
}, n = 0; n < ze.length; n++) {
var a = ze[n];
t[a] = r.getModel([a, e]);
}
return t;
}
function fM(r) {
for (var e = [], t = 0; t < r.length; t++) {
var n = r[t];
if (!n.defaultAttr.ignore) {
var a = n.label, i = a.getComputedTransform(), o = a.getBoundingRect(), s = !i || i[1] < 1e-5 && i[2] < 1e-5, l = a.style.margin || 0, u = o.clone();
u.applyTransform(i), u.x -= l / 2, u.y -= l / 2, u.width += l, u.height += l;
var h = s ? new zh(o, i) : null;
e.push({
label: a,
labelLine: n.labelLine,
rect: u,
localRect: o,
obb: h,
priority: n.priority,
defaultAttr: n.defaultAttr,
layoutOption: n.computedLayoutOption,
axisAligned: s,
transform: i
});
}
}
return e;
}
function cM(r, e, t, n, a, i) {
var o = r.length;
if (o < 2)
return;
r.sort(function(b, w) {
return b.rect[e] - w.rect[e];
});
for (var s = 0, l, u = !1, h = 0; h < o; h++) {
var f = r[h], c = f.rect;
l = c[e] - s, l < 0 && (c[e] -= l, f.label[e] -= l, u = !0), s = c[e] + c[t];
}
var v = r[0], p = r[o - 1], d, g;
y(), d < 0 && S(-d, 0.8), g < 0 && S(g, 0.8), y(), m(d, g, 1), m(g, d, -1), y(), d < 0 && x(-d), g < 0 && x(g);
function y() {
d = v.rect[e] - n, g = a - p.rect[e] - p.rect[t];
}
function m(b, w, T) {
if (b < 0) {
var C = Math.min(w, -b);
if (C > 0) {
_(C * T, 0, o);
var D = C + b;
D < 0 && S(-D * T, 1);
} else
S(-b * T, 1);
}
}
function _(b, w, T) {
b !== 0 && (u = !0);
for (var C = w; C < T; C++) {
var D = r[C], M = D.rect;
M[e] += b, D.label[e] += b;
}
}
function S(b, w) {
for (var T = [], C = 0, D = 1; D < o; D++) {
var M = r[D - 1].rect, I = Math.max(r[D].rect[e] - M[e] - M[t], 0);
T.push(I), C += I;
}
if (C) {
var L = Math.min(Math.abs(b) / C, w);
if (b > 0)
for (var D = 0; D < o - 1; D++) {
var E = T[D] * L;
_(E, 0, D + 1);
}
else
for (var D = o - 1; D > 0; D--) {
var E = T[D - 1] * L;
_(-E, D, o);
}
}
}
function x(b) {
var w = b < 0 ? -1 : 1;
b = Math.abs(b);
for (var T = Math.ceil(b / (o - 1)), C = 0; C < o - 1; C++)
if (w > 0 ? _(T, 0, C + 1) : _(-T, o - C - 1, o), b -= T, b <= 0)
return;
}
return u;
}
function Rz(r, e, t, n) {
return cM(r, "x", "width", e, t);
}
function vM(r, e, t, n) {
return cM(r, "y", "height", e, t);
}
function pM(r) {
var e = [];
r.sort(function(d, g) {
return g.priority - d.priority;
});
var t = new ct(0, 0, 0, 0);
function n(d) {
if (!d.ignore) {
var g = d.ensureState("emphasis");
g.ignore == null && (g.ignore = !1);
}
d.ignore = !0;
}
for (var a = 0; a < r.length; a++) {
var i = r[a], o = i.axisAligned, s = i.localRect, l = i.transform, u = i.label, h = i.labelLine;
t.copy(i.rect), t.width -= 0.1, t.height -= 0.1, t.x += 0.05, t.y += 0.05;
for (var f = i.obb, c = !1, v = 0; v < e.length; v++) {
var p = e[v];
if (t.intersect(p.rect)) {
if (o && p.axisAligned) {
c = !0;
break;
}
if (p.obb || (p.obb = new zh(p.localRect, p.transform)), f || (f = new zh(s, l)), f.intersect(p.obb)) {
c = !0;
break;
}
}
}
c ? (n(u), h && n(h)) : (u.attr("ignore", i.defaultAttr.ignore), h && h.attr("ignore", i.defaultAttr.labelGuideIgnore), e.push(i));
}
}
function Nz(r) {
if (r) {
for (var e = [], t = 0; t < r.length; t++)
e.push(r[t].slice());
return e;
}
}
function Oz(r, e) {
var t = r.label, n = e && e.getTextGuideLine();
return {
dataIndex: r.dataIndex,
dataType: r.dataType,
seriesIndex: r.seriesModel.seriesIndex,
text: r.label.style.text,
rect: r.hostRect,
labelRect: r.rect,
// x: labelAttr.x,
// y: labelAttr.y,
align: t.style.align,
verticalAlign: t.style.verticalAlign,
labelLinePoints: Nz(n && n.shape.points)
};
}
var Q1 = ["align", "verticalAlign", "width", "height", "fontSize"], Me = new mn(), Lv = bt(), Vz = bt();
function ku(r, e, t) {
for (var n = 0; n < t.length; n++) {
var a = t[n];
e[a] != null && (r[a] = e[a]);
}
}
var Ru = ["x", "y", "rotation"], Bz = (
/** @class */
function() {
function r() {
this._labelList = [], this._chartViewList = [];
}
return r.prototype.clearLabels = function() {
this._labelList = [], this._chartViewList = [];
}, r.prototype._addLabel = function(e, t, n, a, i) {
var o = a.style, s = a.__hostTarget, l = s.textConfig || {}, u = a.getComputedTransform(), h = a.getBoundingRect().plain();
ct.applyTransform(h, h, u), u ? Me.setLocalTransform(u) : (Me.x = Me.y = Me.rotation = Me.originX = Me.originY = 0, Me.scaleX = Me.scaleY = 1), Me.rotation = Je(Me.rotation);
var f = a.__hostTarget, c;
if (f) {
c = f.getBoundingRect().plain();
var v = f.getComputedTransform();
ct.applyTransform(c, c, v);
}
var p = c && f.getTextGuideLine();
this._labelList.push({
label: a,
labelLine: p,
seriesModel: n,
dataIndex: e,
dataType: t,
layoutOption: i,
computedLayoutOption: null,
rect: h,
hostRect: c,
// Label with lower priority will be hidden when overlapped
// Use rect size as default priority
priority: c ? c.width * c.height : 0,
// Save default label attributes.
// For restore if developers want get back to default value in callback.
defaultAttr: {
ignore: a.ignore,
labelGuideIgnore: p && p.ignore,
x: Me.x,
y: Me.y,
scaleX: Me.scaleX,
scaleY: Me.scaleY,
rotation: Me.rotation,
style: {
x: o.x,
y: o.y,
align: o.align,
verticalAlign: o.verticalAlign,
width: o.width,
height: o.height,
fontSize: o.fontSize
},
cursor: a.cursor,
attachedPos: l.position,
attachedRot: l.rotation
}
});
}, r.prototype.addLabelsOfSeries = function(e) {
var t = this;
this._chartViewList.push(e);
var n = e.__model, a = n.get("labelLayout");
(K(a) || St(a).length) && e.group.traverse(function(i) {
if (i.ignore)
return !0;
var o = i.getTextContent(), s = it(i);
o && !o.disableLabelLayout && t._addLabel(s.dataIndex, s.dataType, n, o, a);
});
}, r.prototype.updateLayoutConfig = function(e) {
var t = e.getWidth(), n = e.getHeight();
function a(_, S) {
return function() {
j1(_, S);
};
}
for (var i = 0; i < this._labelList.length; i++) {
var o = this._labelList[i], s = o.label, l = s.__hostTarget, u = o.defaultAttr, h = void 0;
K(o.layoutOption) ? h = o.layoutOption(Oz(o, l)) : h = o.layoutOption, h = h || {}, o.computedLayoutOption = h;
var f = Math.PI / 180;
l && l.setTextConfig({
// Force to set local false.
local: !1,
// Ignore position and rotation config on the host el if x or y is changed.
position: h.x != null || h.y != null ? null : u.attachedPos,
// Ignore rotation config on the host el if rotation is changed.
rotation: h.rotate != null ? h.rotate * f : u.attachedRot,
offset: [h.dx || 0, h.dy || 0]
});
var c = !1;
if (h.x != null ? (s.x = W(h.x, t), s.setStyle("x", 0), c = !0) : (s.x = u.x, s.setStyle("x", u.style.x)), h.y != null ? (s.y = W(h.y, n), s.setStyle("y", 0), c = !0) : (s.y = u.y, s.setStyle("y", u.style.y)), h.labelLinePoints) {
var v = l.getTextGuideLine();
v && (v.setShape({
points: h.labelLinePoints
}), c = !1);
}
var p = Lv(s);
p.needsUpdateLabelLine = c, s.rotation = h.rotate != null ? h.rotate * f : u.rotation, s.scaleX = u.scaleX, s.scaleY = u.scaleY;
for (var d = 0; d < Q1.length; d++) {
var g = Q1[d];
s.setStyle(g, h[g] != null ? h[g] : u.style[g]);
}
if (h.draggable) {
if (s.draggable = !0, s.cursor = "move", l) {
var y = o.seriesModel;
if (o.dataIndex != null) {
var m = o.seriesModel.getData(o.dataType);
y = m.getItemModel(o.dataIndex);
}
s.on("drag", a(l, y.getModel("labelLine")));
}
} else
s.off("drag"), s.cursor = u.cursor;
}
}, r.prototype.layout = function(e) {
var t = e.getWidth(), n = e.getHeight(), a = fM(this._labelList), i = At(a, function(l) {
return l.layoutOption.moveOverlap === "shiftX";
}), o = At(a, function(l) {
return l.layoutOption.moveOverlap === "shiftY";
});
Rz(i, 0, t), vM(o, 0, n);
var s = At(a, function(l) {
return l.layoutOption.hideOverlap;
});
pM(s);
}, r.prototype.processLabelsOverall = function() {
var e = this;
A(this._chartViewList, function(t) {
var n = t.__model, a = t.ignoreLabelLineUpdate, i = n.isAnimationEnabled();
t.group.traverse(function(o) {
if (o.ignore && !o.forceLabelAnimation)
return !0;
var s = !a, l = o.getTextContent();
!s && l && (s = Lv(l).needsUpdateLabelLine), s && e._updateLabelLine(o, n), i && e._animateLabels(o, n);
});
});
}, r.prototype._updateLabelLine = function(e, t) {
var n = e.getTextContent(), a = it(e), i = a.dataIndex;
if (n && i != null) {
var o = t.getData(a.dataType), s = o.getItemModel(i), l = {}, u = o.getItemVisual(i, "style");
if (u) {
var h = o.getVisual("drawType");
l.stroke = u[h];
}
var f = s.getModel("labelLine");
Ky(e, jy(s), l), j1(e, f);
}
}, r.prototype._animateLabels = function(e, t) {
var n = e.getTextContent(), a = e.getTextGuideLine();
if (n && (e.forceLabelAnimation || !n.ignore && !n.invisible && !e.disableLabelAnimation && !_o(e))) {
var i = Lv(n), o = i.oldLayout, s = it(e), l = s.dataIndex, u = {
x: n.x,
y: n.y,
rotation: n.rotation
}, h = t.getData(s.dataType);
if (o) {
n.attr(o);
var c = e.prevStates;
c && (pt(c, "select") >= 0 && n.attr(i.oldLayoutSelect), pt(c, "emphasis") >= 0 && n.attr(i.oldLayoutEmphasis)), Ct(n, u, t, l);
} else if (n.attr(u), !Fo(n).valueAnimation) {
var f = ot(n.style.opacity, 1);
n.style.opacity = 0, $t(n, {
style: {
opacity: f
}
}, t, l);
}
if (i.oldLayout = u, n.states.select) {
var v = i.oldLayoutSelect = {};
ku(v, u, Ru), ku(v, n.states.select, Ru);
}
if (n.states.emphasis) {
var p = i.oldLayoutEmphasis = {};
ku(p, u, Ru), ku(p, n.states.emphasis, Ru);
}
sD(n, l, h, t, t);
}
if (a && !a.ignore && !a.invisible) {
var i = Vz(a), o = i.oldLayout, d = {
points: a.shape.points
};
o ? (a.attr({
shape: o
}), Ct(a, {
shape: d
}, t)) : (a.setShape(d), a.style.strokePercent = 0, $t(a, {
style: {
strokePercent: 1
}
}, t)), i.oldLayout = d;
}
}, r;
}()
), Ev = bt();
function zz(r) {
r.registerUpdateLifecycle("series:beforeupdate", function(e, t, n) {
var a = Ev(t).labelManager;
a || (a = Ev(t).labelManager = new Bz()), a.clearLabels();
}), r.registerUpdateLifecycle("series:layoutlabels", function(e, t, n) {
var a = Ev(t).labelManager;
n.updatedSeries.forEach(function(i) {
a.addLabelsOfSeries(t.getViewOfSeriesModel(i));
}), a.updateLayoutConfig(t), a.layout(t), a.processLabelsOverall();
});
}
var Pv = Math.sin, kv = Math.cos, dM = Math.PI, Ha = Math.PI * 2, Gz = 180 / dM, gM = function() {
function r() {
}
return r.prototype.reset = function(e) {
this._start = !0, this._d = [], this._str = "", this._p = Math.pow(10, e || 4);
}, r.prototype.moveTo = function(e, t) {
this._add("M", e, t);
}, r.prototype.lineTo = function(e, t) {
this._add("L", e, t);
}, r.prototype.bezierCurveTo = function(e, t, n, a, i, o) {
this._add("C", e, t, n, a, i, o);
}, r.prototype.quadraticCurveTo = function(e, t, n, a) {
this._add("Q", e, t, n, a);
}, r.prototype.arc = function(e, t, n, a, i, o) {
this.ellipse(e, t, n, n, 0, a, i, o);
}, r.prototype.ellipse = function(e, t, n, a, i, o, s, l) {
var u = s - o, h = !l, f = Math.abs(u), c = ra(f - Ha) || (h ? u >= Ha : -u >= Ha), v = u > 0 ? u % Ha : u % Ha + Ha, p = !1;
c ? p = !0 : ra(f) ? p = !1 : p = v >= dM == !!h;
var d = e + n * kv(o), g = t + a * Pv(o);
this._start && this._add("M", d, g);
var y = Math.round(i * Gz);
if (c) {
var m = 1 / this._p, _ = (h ? 1 : -1) * (Ha - m);
this._add("A", n, a, y, 1, +h, e + n * kv(o + _), t + a * Pv(o + _)), m > 0.01 && this._add("A", n, a, y, 0, +h, d, g);
} else {
var S = e + n * kv(s), x = t + a * Pv(s);
this._add("A", n, a, y, +p, +h, S, x);
}
}, r.prototype.rect = function(e, t, n, a) {
this._add("M", e, t), this._add("l", n, 0), this._add("l", 0, a), this._add("l", -n, 0), this._add("Z");
}, r.prototype.closePath = function() {
this._d.length > 0 && this._add("Z");
}, r.prototype._add = function(e, t, n, a, i, o, s, l, u) {
for (var h = [], f = this._p, c = 1; c < arguments.length; c++) {
var v = arguments[c];
if (isNaN(v)) {
this._invalid = !0;
return;
}
h.push(Math.round(v * f) / f);
}
this._d.push(e + h.join(" ")), this._start = e === "Z";
}, r.prototype.generateStr = function() {
this._str = this._invalid ? "" : this._d.join(""), this._d = [];
}, r.prototype.getStr = function() {
return this._str;
}, r;
}(), Qy = "none", Fz = Math.round;
function Hz(r) {
var e = r.fill;
return e != null && e !== Qy;
}
function Wz(r) {
var e = r.stroke;
return e != null && e !== Qy;
}
var jd = ["lineCap", "miterLimit", "lineJoin"], $z = G(jd, function(r) {
return "stroke-" + r.toLowerCase();
});
function Uz(r, e, t, n) {
var a = e.opacity == null ? 1 : e.opacity;
if (t instanceof ge) {
r("opacity", a);
return;
}
if (Hz(e)) {
var i = ul(e.fill);
r("fill", i.color);
var o = e.fillOpacity != null ? e.fillOpacity * i.opacity * a : i.opacity * a;
o < 1 && r("fill-opacity", o);
} else
r("fill", Qy);
if (Wz(e)) {
var s = ul(e.stroke);
r("stroke", s.color);
var l = e.strokeNoScale ? t.getLineScale() : 1, u = l ? (e.lineWidth || 0) / l : 0, h = e.strokeOpacity != null ? e.strokeOpacity * s.opacity * a : s.opacity * a, f = e.strokeFirst;
if (u !== 1 && r("stroke-width", u), f && r("paint-order", f ? "stroke" : "fill"), h < 1 && r("stroke-opacity", h), e.lineDash) {
var c = zy(t), v = c[0], p = c[1];
v && (p = Fz(p || 0), r("stroke-dasharray", v.join(",")), (p || n) && r("stroke-dashoffset", p));
}
for (var d = 0; d < jd.length; d++) {
var g = jd[d];
if (e[g] !== Vh[g]) {
var y = e[g] || Vh[g];
y && r($z[d], y);
}
}
}
}
var yM = "http://www.w3.org/2000/svg", mM = "http://www.w3.org/1999/xlink", Yz = "http://www.w3.org/2000/xmlns/", Zz = "http://www.w3.org/XML/1998/namespace", J1 = "ecmeta_";
function _M(r) {
return document.createElementNS(yM, r);
}
function fe(r, e, t, n, a) {
return {
tag: r,
attrs: t || {},
children: n,
text: a,
key: e
};
}
function Xz(r, e) {
var t = [];
if (e)
for (var n in e) {
var a = e[n], i = n;
a !== !1 && (a !== !0 && a != null && (i += '="' + a + '"'), t.push(i));
}
return "<" + r + " " + t.join(" ") + ">";
}
function qz(r) {
return "</" + r + ">";
}
function Jy(r, e) {
e = e || {};
var t = e.newline ? `
` : "";
function n(a) {
var i = a.children, o = a.tag, s = a.attrs, l = a.text;
return Xz(o, s) + (o !== "style" ? ke(l) : l || "") + (i ? "" + t + G(i, function(u) {
return n(u);
}).join(t) + t : "") + qz(o);
}
return n(r);
}
function Kz(r, e, t) {
t = t || {};
var n = t.newline ? `
` : "", a = " {" + n, i = n + "}", o = G(St(r), function(l) {
return l + a + G(St(r[l]), function(u) {
return u + ":" + r[l][u] + ";";
}).join(n) + i;
}).join(n), s = G(St(e), function(l) {
return "@keyframes " + l + a + G(St(e[l]), function(u) {
return u + a + G(St(e[l][u]), function(h) {
var f = e[l][u][h];
return h === "d" && (f = 'path("' + f + '")'), h + ":" + f + ";";
}).join(n) + i;
}).join(n) + i;
}).join(n);
return !o && !s ? "" : ["<![CDATA[", o, s, "]]>"].join(n);
}
function Qd(r) {
return {
zrId: r,
shadowCache: {},
patternCache: {},
gradientCache: {},
clipPathCache: {},
defs: {},
cssNodes: {},
cssAnims: {},
cssStyleCache: {},
cssAnimIdx: 0,
shadowIdx: 0,
gradientIdx: 0,
patternIdx: 0,
clipPathIdx: 0
};
}
function tS(r, e, t, n) {
return fe("svg", "root", {
width: r,
height: e,
xmlns: yM,
"xmlns:xlink": mM,
version: "1.1",
baseProfile: "full",
viewBox: n ? "0 0 " + r + " " + e : !1
}, t);
}
var jz = 0;
function SM() {
return jz++;
}
var eS = {
cubicIn: "0.32,0,0.67,0",
cubicOut: "0.33,1,0.68,1",
cubicInOut: "0.65,0,0.35,1",
quadraticIn: "0.11,0,0.5,0",
quadraticOut: "0.5,1,0.89,1",
quadraticInOut: "0.45,0,0.55,1",
quarticIn: "0.5,0,0.75,0",
quarticOut: "0.25,1,0.5,1",
quarticInOut: "0.76,0,0.24,1",
quinticIn: "0.64,0,0.78,0",
quinticOut: "0.22,1,0.36,1",
quinticInOut: "0.83,0,0.17,1",
sinusoidalIn: "0.12,0,0.39,0",
sinusoidalOut: "0.61,1,0.88,1",
sinusoidalInOut: "0.37,0,0.63,1",
exponentialIn: "0.7,0,0.84,0",
exponentialOut: "0.16,1,0.3,1",
exponentialInOut: "0.87,0,0.13,1",
circularIn: "0.55,0,1,0.45",
circularOut: "0,0.55,0.45,1",
circularInOut: "0.85,0,0.15,1"
}, Ua = "transform-origin";
function Qz(r, e, t) {
var n = B({}, r.shape);
B(n, e), r.buildPath(t, n);
var a = new gM();
return a.reset(aC(r)), t.rebuildPath(a, 1), a.generateStr(), a.getStr();
}
function Jz(r, e) {
var t = e.originX, n = e.originY;
(t || n) && (r[Ua] = t + "px " + n + "px");
}
var t5 = {
fill: "fill",
opacity: "opacity",
lineWidth: "stroke-width",
lineDashOffset: "stroke-dashoffset"
};
function xM(r, e) {
var t = e.zrId + "-ani-" + e.cssAnimIdx++;
return e.cssAnims[t] = r, t;
}
function e5(r, e, t) {
var n = r.shape.paths, a = {}, i, o;
if (A(n, function(l) {
var u = Qd(t.zrId);
u.animation = !0, fc(l, {}, u, !0);
var h = u.cssAnims, f = u.cssNodes, c = St(h), v = c.length;
if (v) {
o = c[v - 1];
var p = h[o];
for (var d in p) {
var g = p[d];
a[d] = a[d] || { d: "" }, a[d].d += g.d || "";
}
for (var y in f) {
var m = f[y].animation;
m.indexOf(o) >= 0 && (i = m);
}
}
}), !!i) {
e.d = !1;
var s = xM(a, t);
return i.replace(o, s);
}
}
function rS(r) {
return U(r) ? eS[r] ? "cubic-bezier(" + eS[r] + ")" : ay(r) ? r : "" : "";
}
function fc(r, e, t, n) {
var a = r.animators, i = a.length, o = [];
if (r instanceof _y) {
var s = e5(r, e, t);
if (s)
o.push(s);
else if (!i)
return;
} else if (!i)
return;
for (var l = {}, u = 0; u < i; u++) {
var h = a[u], f = [h.getMaxTime() / 1e3 + "s"], c = rS(h.getClip().easing), v = h.getDelay();
c ? f.push(c) : f.push("linear"), v && f.push(v / 1e3 + "s"), h.getLoop() && f.push("infinite");
var p = f.join(" ");
l[p] = l[p] || [p, []], l[p][1].push(h);
}
function d(m) {
var _ = m[1], S = _.length, x = {}, b = {}, w = {}, T = "animation-timing-function";
function C(vt, rt, dt) {
for (var q = vt.getTracks(), lt = vt.getMaxTime(), Vt = 0; Vt < q.length; Vt++) {
var Lt = q[Vt];
if (Lt.needsAnimate()) {
var Rt = Lt.keyframes, Ut = Lt.propName;
if (dt && (Ut = dt(Ut)), Ut)
for (var le = 0; le < Rt.length; le++) {
var Ke = Rt[le], We = Math.round(Ke.time / lt * 100) + "%", Sa = rS(Ke.easing), Vn = Ke.rawValue;
(U(Vn) || Tt(Vn)) && (rt[We] = rt[We] || {}, rt[We][Ut] = Ke.rawValue, Sa && (rt[We][T] = Sa));
}
}
}
}
for (var D = 0; D < S; D++) {
var M = _[D], I = M.targetName;
I ? I === "shape" && C(M, b) : !n && C(M, x);
}
for (var L in x) {
var E = {};
uC(E, r), B(E, x[L]);
var P = iC(E), k = x[L][T];
w[L] = P ? {
transform: P
} : {}, Jz(w[L], E), k && (w[L][T] = k);
}
var N, R = !0;
for (var L in b) {
w[L] = w[L] || {};
var V = !N, k = b[L][T];
V && (N = new sn());
var F = N.len();
N.reset(), w[L].d = Qz(r, b[L], N);
var H = N.len();
if (!V && F !== H) {
R = !1;
break;
}
k && (w[L][T] = k);
}
if (!R)
for (var L in w)
delete w[L].d;
if (!n)
for (var D = 0; D < S; D++) {
var M = _[D], I = M.targetName;
I === "style" && C(M, w, function(q) {
return t5[q];
});
}
for (var $ = St(w), j = !0, Q, D = 1; D < $.length; D++) {
var st = $[D - 1], Et = $[D];
if (w[st][Ua] !== w[Et][Ua]) {
j = !1;
break;
}
Q = w[st][Ua];
}
if (j && Q) {
for (var L in w)
w[L][Ua] && delete w[L][Ua];
e[Ua] = Q;
}
if (At($, function(vt) {
return St(w[vt]).length > 0;
}).length) {
var qt = xM(w, t);
return qt + " " + m[0] + " both";
}
}
for (var g in l) {
var s = d(l[g]);
s && o.push(s);
}
if (o.length) {
var y = t.zrId + "-cls-" + SM();
t.cssNodes["." + y] = {
animation: o.join(",")
}, e.class = y;
}
}
function r5(r, e, t) {
if (!r.ignore)
if (r.isSilent()) {
var n = {
"pointer-events": "none"
};
nS(n, e, t);
} else {
var a = r.states.emphasis && r.states.emphasis.style ? r.states.emphasis.style : {}, i = a.fill;
if (!i) {
var o = r.style && r.style.fill, s = r.states.select && r.states.select.style && r.states.select.style.fill, l = r.currentStates.indexOf("select") >= 0 && s || o;
l && (i = ld(l));
}
var u = a.lineWidth;
if (u) {
var h = !a.strokeNoScale && r.transform ? r.transform[0] : 1;
u = u / h;
}
var n = {
cursor: "pointer"
};
i && (n.fill = i), a.stroke && (n.stroke = a.stroke), u && (n["stroke-width"] = u), nS(n, e, t);
}
}
function nS(r, e, t, n) {
var a = JSON.stringify(r), i = t.cssStyleCache[a];
i || (i = t.zrId + "-cls-" + SM(), t.cssStyleCache[a] = i, t.cssNodes["." + i + ":hover"] = r), e.class = e.class ? e.class + " " + i : i;
}
var Sl = Math.round;
function bM(r) {
return r && U(r.src);
}
function wM(r) {
return r && K(r.toDataURL);
}
function tm(r, e, t, n) {
Uz(function(a, i) {
var o = a === "fill" || a === "stroke";
o && nC(i) ? CM(e, r, a, n) : o && iy(i) ? DM(t, r, a, n) : r[a] = i, o && n.ssr && i === "none" && (r["pointer-events"] = "visible");
}, e, t, !1), u5(t, r, n);
}
function em(r, e) {
var t = ZP(e);
t && (t.each(function(n, a) {
n != null && (r[(J1 + a).toLowerCase()] = n + "");
}), e.isSilent() && (r[J1 + "silent"] = "true"));
}
function aS(r) {
return ra(r[0] - 1) && ra(r[1]) && ra(r[2]) && ra(r[3] - 1);
}
function n5(r) {
return ra(r[4]) && ra(r[5]);
}
function rm(r, e, t) {
if (e && !(n5(e) && aS(e))) {
var n = 1e4;
r.transform = aS(e) ? "translate(" + Sl(e[4] * n) / n + " " + Sl(e[5] * n) / n + ")" : dP(e);
}
}
function iS(r, e, t) {
for (var n = r.points, a = [], i = 0; i < n.length; i++)
a.push(Sl(n[i][0] * t) / t), a.push(Sl(n[i][1] * t) / t);
e.points = a.join(" ");
}
function oS(r) {
return !r.smooth;
}
function a5(r) {
var e = G(r, function(t) {
return typeof t == "string" ? [t, t] : t;
});
return function(t, n, a) {
for (var i = 0; i < e.length; i++) {
var o = e[i], s = t[o[0]];
s != null && (n[o[1]] = Sl(s * a) / a);
}
};
}
var i5 = {
circle: [a5(["cx", "cy", "r"])],
polyline: [iS, oS],
polygon: [iS, oS]
};
function o5(r) {
for (var e = r.animators, t = 0; t < e.length; t++)
if (e[t].targetName === "shape")
return !0;
return !1;
}
function TM(r, e) {
var t = r.style, n = r.shape, a = i5[r.type], i = {}, o = e.animation, s = "path", l = r.style.strokePercent, u = e.compress && aC(r) || 4;
if (a && !e.willUpdate && !(a[1] && !a[1](n)) && !(o && o5(r)) && !(l < 1)) {
s = r.type;
var h = Math.pow(10, u);
a[0](n, i, h);
} else {
var f = !r.path || r.shapeChanged();
r.path || r.createPathProxy();
var c = r.path;
f && (c.beginPath(), r.buildPath(c, r.shape), r.pathUpdated());
var v = c.getVersion(), p = r, d = p.__svgPathBuilder;
(p.__svgPathVersion !== v || !d || l !== p.__svgPathStrokePercent) && (d || (d = p.__svgPathBuilder = new gM()), d.reset(u), c.rebuildPath(d, l), d.generateStr(), p.__svgPathVersion = v, p.__svgPathStrokePercent = l), i.d = d.getStr();
}
return rm(i, r.transform), tm(i, t, r, e), em(i, r), e.animation && fc(r, i, e), e.emphasis && r5(r, i, e), fe(s, r.id + "", i);
}
function s5(r, e) {
var t = r.style, n = t.image;
if (n && !U(n) && (bM(n) ? n = n.src : wM(n) && (n = n.toDataURL())), !!n) {
var a = t.x || 0, i = t.y || 0, o = t.width, s = t.height, l = {
href: n,
width: o,
height: s
};
return a && (l.x = a), i && (l.y = i), rm(l, r.transform), tm(l, t, r, e), em(l, r), e.animation && fc(r, l, e), fe("image", r.id + "", l);
}
}
function l5(r, e) {
var t = r.style, n = t.text;
if (n != null && (n += ""), !(!n || isNaN(t.x) || isNaN(t.y))) {
var a = t.font || ua, i = t.x || 0, o = yP(t.y || 0, Nf(a), t.textBaseline), s = gP[t.textAlign] || t.textAlign, l = {
"dominant-baseline": "central",
"text-anchor": s
};
if (RC(t)) {
var u = "", h = t.fontStyle, f = kC(t.fontSize);
if (!parseFloat(f))
return;
var c = t.fontFamily || PT, v = t.fontWeight;
u += "font-size:" + f + ";font-family:" + c + ";", h && h !== "normal" && (u += "font-style:" + h + ";"), v && v !== "normal" && (u += "font-weight:" + v + ";"), l.style = u;
} else
l.style = "font: " + a;
return n.match(/\s/) && (l["xml:space"] = "preserve"), i && (l.x = i), o && (l.y = o), rm(l, r.transform), tm(l, t, r, e), em(l, r), e.animation && fc(r, l, e), fe("text", r.id + "", l, void 0, n);
}
}
function sS(r, e) {
if (r instanceof mt)
return TM(r, e);
if (r instanceof ge)
return s5(r, e);
if (r instanceof Co)
return l5(r, e);
}
function u5(r, e, t) {
var n = r.style;
if (mP(n)) {
var a = _P(r), i = t.shadowCache, o = i[a];
if (!o) {
var s = r.getGlobalScale(), l = s[0], u = s[1];
if (!l || !u)
return;
var h = n.shadowOffsetX || 0, f = n.shadowOffsetY || 0, c = n.shadowBlur, v = ul(n.shadowColor), p = v.opacity, d = v.color, g = c / 2 / l, y = c / 2 / u, m = g + " " + y;
o = t.zrId + "-s" + t.shadowIdx++, t.defs[o] = fe("filter", o, {
id: o,
x: "-100%",
y: "-100%",
width: "300%",
height: "300%"
}, [
fe("feDropShadow", "", {
dx: h / l,
dy: f / u,
stdDeviation: m,
"flood-color": d,
"flood-opacity": p
})
]), i[a] = o;
}
e.filter = Rf(o);
}
}
function CM(r, e, t, n) {
var a = r[t], i, o = {
gradientUnits: a.global ? "userSpaceOnUse" : "objectBoundingBox"
};
if (eC(a))
i = "linearGradient", o.x1 = a.x, o.y1 = a.y, o.x2 = a.x2, o.y2 = a.y2;
else if (rC(a))
i = "radialGradient", o.cx = ot(a.x, 0.5), o.cy = ot(a.y, 0.5), o.r = ot(a.r, 0.5);
else {
process.env.NODE_ENV !== "production" && Er("Illegal gradient type.");
return;
}
for (var s = a.colorStops, l = [], u = 0, h = s.length; u < h; ++u) {
var f = ud(s[u].offset) * 100 + "%", c = s[u].color, v = ul(c), p = v.color, d = v.opacity, g = {
offset: f
};
g["stop-color"] = p, d < 1 && (g["stop-opacity"] = d), l.push(fe("stop", u + "", g));
}
var y = fe(i, "", o, l), m = Jy(y), _ = n.gradientCache, S = _[m];
S || (S = n.zrId + "-g" + n.gradientIdx++, _[m] = S, o.id = S, n.defs[S] = fe(i, S, o, l)), e[t] = Rf(S);
}
function DM(r, e, t, n) {
var a = r.style[t], i = r.getBoundingRect(), o = {}, s = a.repeat, l = s === "no-repeat", u = s === "repeat-x", h = s === "repeat-y", f;
if (tC(a)) {
var c = a.imageWidth, v = a.imageHeight, p = void 0, d = a.image;
if (U(d) ? p = d : bM(d) ? p = d.src : wM(d) && (p = d.toDataURL()), typeof Image > "u") {
var g = "Image width/height must been given explictly in svg-ssr renderer.";
tt(c, g), tt(v, g);
} else if (c == null || v == null) {
var y = function(D, M) {
if (D) {
var I = D.elm, L = c || M.width, E = v || M.height;
D.tag === "pattern" && (u ? (E = 1, L /= i.width) : h && (L = 1, E /= i.height)), D.attrs.width = L, D.attrs.height = E, I && (I.setAttribute("width", L), I.setAttribute("height", E));
}
}, m = fy(p, null, r, function(D) {
l || y(b, D), y(f, D);
});
m && m.width && m.height && (c = c || m.width, v = v || m.height);
}
f = fe("image", "img", {
href: p,
width: c,
height: v
}), o.width = c, o.height = v;
} else a.svgElement && (f = nt(a.svgElement), o.width = a.svgWidth, o.height = a.svgHeight);
if (f) {
var _, S;
l ? _ = S = 1 : u ? (S = 1, _ = o.width / i.width) : h ? (_ = 1, S = o.height / i.height) : o.patternUnits = "userSpaceOnUse", _ != null && !isNaN(_) && (o.width = _), S != null && !isNaN(S) && (o.height = S);
var x = iC(a);
x && (o.patternTransform = x);
var b = fe("pattern", "", o, [f]), w = Jy(b), T = n.patternCache, C = T[w];
C || (C = n.zrId + "-p" + n.patternIdx++, T[w] = C, o.id = C, b = n.defs[C] = fe("pattern", C, o, [f])), e[t] = Rf(C);
}
}
function h5(r, e, t) {
var n = t.clipPathCache, a = t.defs, i = n[r.id];
if (!i) {
i = t.zrId + "-c" + t.clipPathIdx++;
var o = {
id: i
};
n[r.id] = i, a[i] = fe("clipPath", i, o, [TM(r, t)]);
}
e["clip-path"] = Rf(i);
}
function lS(r) {
return document.createTextNode(r);
}
function Qa(r, e, t) {
r.insertBefore(e, t);
}
function uS(r, e) {
r.removeChild(e);
}
function hS(r, e) {
r.appendChild(e);
}
function AM(r) {
return r.parentNode;
}
function MM(r) {
return r.nextSibling;
}
function Rv(r, e) {
r.textContent = e;
}
var fS = 58, f5 = 120, c5 = fe("", "");
function Jd(r) {
return r === void 0;
}
function Zr(r) {
return r !== void 0;
}
function v5(r, e, t) {
for (var n = {}, a = e; a <= t; ++a) {
var i = r[a].key;
i !== void 0 && (process.env.NODE_ENV !== "production" && n[i] != null && console.error("Duplicate key " + i), n[i] = a);
}
return n;
}
function Bs(r, e) {
var t = r.key === e.key, n = r.tag === e.tag;
return n && t;
}
function xl(r) {
var e, t = r.children, n = r.tag;
if (Zr(n)) {
var a = r.elm = _M(n);
if (nm(c5, r), z(t))
for (e = 0; e < t.length; ++e) {
var i = t[e];
i != null && hS(a, xl(i));
}
else Zr(r.text) && !J(r.text) && hS(a, lS(r.text));
} else
r.elm = lS(r.text);
return r.elm;
}
function IM(r, e, t, n, a) {
for (; n <= a; ++n) {
var i = t[n];
i != null && Qa(r, xl(i), e);
}
}
function af(r, e, t, n) {
for (; t <= n; ++t) {
var a = e[t];
if (a != null)
if (Zr(a.tag)) {
var i = AM(a.elm);
uS(i, a.elm);
} else
uS(r, a.elm);
}
}
function nm(r, e) {
var t, n = e.elm, a = r && r.attrs || {}, i = e.attrs || {};
if (a !== i) {
for (t in i) {
var o = i[t], s = a[t];
s !== o && (o === !0 ? n.setAttribute(t, "") : o === !1 ? n.removeAttribute(t) : t === "style" ? n.style.cssText = o : t.charCodeAt(0) !== f5 ? n.setAttribute(t, o) : t === "xmlns:xlink" || t === "xmlns" ? n.setAttributeNS(Yz, t, o) : t.charCodeAt(3) === fS ? n.setAttributeNS(Zz, t, o) : t.charCodeAt(5) === fS ? n.setAttributeNS(mM, t, o) : n.setAttribute(t, o));
}
for (t in a)
t in i || n.removeAttribute(t);
}
}
function p5(r, e, t) {
for (var n = 0, a = 0, i = e.length - 1, o = e[0], s = e[i], l = t.length - 1, u = t[0], h = t[l], f, c, v, p; n <= i && a <= l; )
o == null ? o = e[++n] : s == null ? s = e[--i] : u == null ? u = t[++a] : h == null ? h = t[--l] : Bs(o, u) ? (ho(o, u), o = e[++n], u = t[++a]) : Bs(s, h) ? (ho(s, h), s = e[--i], h = t[--l]) : Bs(o, h) ? (ho(o, h), Qa(r, o.elm, MM(s.elm)), o = e[++n], h = t[--l]) : Bs(s, u) ? (ho(s, u), Qa(r, s.elm, o.elm), s = e[--i], u = t[++a]) : (Jd(f) && (f = v5(e, n, i)), c = f[u.key], Jd(c) ? Qa(r, xl(u), o.elm) : (v = e[c], v.tag !== u.tag ? Qa(r, xl(u), o.elm) : (ho(v, u), e[c] = void 0, Qa(r, v.elm, o.elm))), u = t[++a]);
(n <= i || a <= l) && (n > i ? (p = t[l + 1] == null ? null : t[l + 1].elm, IM(r, p, t, a, l)) : af(r, e, n, i));
}
function ho(r, e) {
var t = e.elm = r.elm, n = r.children, a = e.children;
r !== e && (nm(r, e), Jd(e.text) ? Zr(n) && Zr(a) ? n !== a && p5(t, n, a) : Zr(a) ? (Zr(r.text) && Rv(t, ""), IM(t, null, a, 0, a.length - 1)) : Zr(n) ? af(t, n, 0, n.length - 1) : Zr(r.text) && Rv(t, "") : r.text !== e.text && (Zr(n) && af(t, n, 0, n.length - 1), Rv(t, e.text)));
}
function d5(r, e) {
if (Bs(r, e))
ho(r, e);
else {
var t = r.elm, n = AM(t);
xl(e), n !== null && (Qa(n, e.elm, MM(t)), af(n, [r], 0, 0));
}
return e;
}
var g5 = 0, y5 = function() {
function r(e, t, n) {
if (this.type = "svg", this.refreshHover = cS("refreshHover"), this.configLayer = cS("configLayer"), this.storage = t, this._opts = n = B({}, n), this.root = e, this._id = "zr" + g5++, this._oldVNode = tS(n.width, n.height), e && !n.ssr) {
var a = this._viewport = document.createElement("div");
a.style.cssText = "position:relative;overflow:hidden";
var i = this._svgDom = this._oldVNode.elm = _M("svg");
nm(null, this._oldVNode), a.appendChild(i), e.appendChild(a);
}
this.resize(n.width, n.height);
}
return r.prototype.getType = function() {
return this.type;
}, r.prototype.getViewportRoot = function() {
return this._viewport;
}, r.prototype.getViewportRootOffset = function() {
var e = this.getViewportRoot();
if (e)
return {
offsetLeft: e.offsetLeft || 0,
offsetTop: e.offsetTop || 0
};
}, r.prototype.getSvgDom = function() {
return this._svgDom;
}, r.prototype.refresh = function() {
if (this.root) {
var e = this.renderToVNode({
willUpdate: !0
});
e.attrs.style = "position:absolute;left:0;top:0;user-select:none", d5(this._oldVNode, e), this._oldVNode = e;
}
}, r.prototype.renderOneToVNode = function(e) {
return sS(e, Qd(this._id));
}, r.prototype.renderToVNode = function(e) {
e = e || {};
var t = this.storage.getDisplayList(!0), n = this._width, a = this._height, i = Qd(this._id);
i.animation = e.animation, i.willUpdate = e.willUpdate, i.compress = e.compress, i.emphasis = e.emphasis, i.ssr = this._opts.ssr;
var o = [], s = this._bgVNode = m5(n, a, this._backgroundColor, i);
s && o.push(s);
var l = e.compress ? null : this._mainVNode = fe("g", "main", {}, []);
this._paintList(t, i, l ? l.children : o), l && o.push(l);
var u = G(St(i.defs), function(c) {
return i.defs[c];
});
if (u.length && o.push(fe("defs", "defs", {}, u)), e.animation) {
var h = Kz(i.cssNodes, i.cssAnims, { newline: !0 });
if (h) {
var f = fe("style", "stl", {}, [], h);
o.push(f);
}
}
return tS(n, a, o, e.useViewBox);
}, r.prototype.renderToString = function(e) {
return e = e || {}, Jy(this.renderToVNode({
animation: ot(e.cssAnimation, !0),
emphasis: ot(e.cssEmphasis, !0),
willUpdate: !1,
compress: !0,
useViewBox: ot(e.useViewBox, !0)
}), { newline: !0 });
}, r.prototype.setBackgroundColor = function(e) {
this._backgroundColor = e;
}, r.prototype.getSvgRoot = function() {
return this._mainVNode && this._mainVNode.elm;
}, r.prototype._paintList = function(e, t, n) {
for (var a = e.length, i = [], o = 0, s, l, u = 0, h = 0; h < a; h++) {
var f = e[h];
if (!f.invisible) {
var c = f.__clipPaths, v = c && c.length || 0, p = l && l.length || 0, d = void 0;
for (d = Math.max(v - 1, p - 1); d >= 0 && !(c && l && c[d] === l[d]); d--)
;
for (var g = p - 1; g > d; g--)
o--, s = i[o - 1];
for (var y = d + 1; y < v; y++) {
var m = {};
h5(c[y], m, t);
var _ = fe("g", "clip-g-" + u++, m, []);
(s ? s.children : n).push(_), i[o++] = _, s = _;
}
l = c;
var S = sS(f, t);
S && (s ? s.children : n).push(S);
}
}
}, r.prototype.resize = function(e, t) {
var n = this._opts, a = this.root, i = this._viewport;
if (e != null && (n.width = e), t != null && (n.height = t), a && i && (i.style.display = "none", e = go(a, 0, n), t = go(a, 1, n), i.style.display = ""), this._width !== e || this._height !== t) {
if (this._width = e, this._height = t, i) {
var o = i.style;
o.width = e + "px", o.height = t + "px";
}
if (iy(this._backgroundColor))
this.refresh();
else {
var s = this._svgDom;
s && (s.setAttribute("width", e), s.setAttribute("height", t));
var l = this._bgVNode && this._bgVNode.elm;
l && (l.setAttribute("width", e), l.setAttribute("height", t));
}
}
}, r.prototype.getWidth = function() {
return this._width;
}, r.prototype.getHeight = function() {
return this._height;
}, r.prototype.dispose = function() {
this.root && (this.root.innerHTML = ""), this._svgDom = this._viewport = this.storage = this._oldVNode = this._bgVNode = this._mainVNode = null;
}, r.prototype.clear = function() {
this._svgDom && (this._svgDom.innerHTML = null), this._oldVNode = null;
}, r.prototype.toDataURL = function(e) {
var t = this.renderToString(), n = "data:image/svg+xml;";
return e ? (t = xP(t), t && n + "base64," + t) : n + "charset=UTF-8," + encodeURIComponent(t);
}, r;
}();
function cS(r) {
return function() {
process.env.NODE_ENV !== "production" && Er('In SVG mode painter not support method "' + r + '"');
};
}
function m5(r, e, t, n) {
var a;
if (t && t !== "none")
if (a = fe("rect", "bg", {
width: r,
height: e,
x: "0",
y: "0"
}), nC(t))
CM({ fill: t }, a.attrs, "fill", n);
else if (iy(t))
DM({
style: {
fill: t
},
dirty: Jt,
getBoundingRect: function() {
return { width: r, height: e };
}
}, a.attrs, "fill", n);
else {
var i = ul(t), o = i.color, s = i.opacity;
a.attrs.fill = o, s < 1 && (a.attrs["fill-opacity"] = s);
}
return a;
}
function _5(r) {
r.registerPainter("svg", y5);
}
function vS(r, e, t) {
var n = ha.createCanvas(), a = e.getWidth(), i = e.getHeight(), o = n.style;
return o && (o.position = "absolute", o.left = "0", o.top = "0", o.width = a + "px", o.height = i + "px", n.setAttribute("data-zr-dom-id", r)), n.width = a * t, n.height = i * t, n;
}
var Nv = function(r) {
Ht(e, r);
function e(t, n, a) {
var i = r.call(this) || this;
i.motionBlur = !1, i.lastFrameAlpha = 0.7, i.dpr = 1, i.virtual = !1, i.config = {}, i.incremental = !1, i.zlevel = 0, i.maxRepaintRectCount = 5, i.__dirty = !0, i.__firstTimePaint = !0, i.__used = !1, i.__drawIndex = 0, i.__startIndex = 0, i.__endIndex = 0, i.__prevStartIndex = null, i.__prevEndIndex = null;
var o;
a = a || Nh, typeof t == "string" ? o = vS(t, n, a) : J(t) && (o = t, t = o.id), i.id = t, i.dom = o;
var s = o.style;
return s && (zT(o), o.onselectstart = function() {
return !1;
}, s.padding = "0", s.margin = "0", s.borderWidth = "0"), i.painter = n, i.dpr = a, i;
}
return e.prototype.getElementCount = function() {
return this.__endIndex - this.__startIndex;
}, e.prototype.afterBrush = function() {
this.__prevStartIndex = this.__startIndex, this.__prevEndIndex = this.__endIndex;
}, e.prototype.initContext = function() {
this.ctx = this.dom.getContext("2d"), this.ctx.dpr = this.dpr;
}, e.prototype.setUnpainted = function() {
this.__firstTimePaint = !0;
}, e.prototype.createBackBuffer = function() {
var t = this.dpr;
this.domBack = vS("back-" + this.id, this.painter, t), this.ctxBack = this.domBack.getContext("2d"), t !== 1 && this.ctxBack.scale(t, t);
}, e.prototype.createRepaintRects = function(t, n, a, i) {
if (this.__firstTimePaint)
return this.__firstTimePaint = !1, null;
var o = [], s = this.maxRepaintRectCount, l = !1, u = new ct(0, 0, 0, 0);
function h(m) {
if (!(!m.isFinite() || m.isZero()))
if (o.length === 0) {
var _ = new ct(0, 0, 0, 0);
_.copy(m), o.push(_);
} else {
for (var S = !1, x = 1 / 0, b = 0, w = 0; w < o.length; ++w) {
var T = o[w];
if (T.intersect(m)) {
var C = new ct(0, 0, 0, 0);
C.copy(T), C.union(m), o[w] = C, S = !0;
break;
} else if (l) {
u.copy(m), u.union(T);
var D = m.width * m.height, M = T.width * T.height, I = u.width * u.height, L = I - D - M;
L < x && (x = L, b = w);
}
}
if (l && (o[b].union(m), S = !0), !S) {
var _ = new ct(0, 0, 0, 0);
_.copy(m), o.push(_);
}
l || (l = o.length >= s);
}
}
for (var f = this.__startIndex; f < this.__endIndex; ++f) {
var c = t[f];
if (c) {
var v = c.shouldBePainted(a, i, !0, !0), p = c.__isRendered && (c.__dirty & tn || !v) ? c.getPrevPaintRect() : null;
p && h(p);
var d = v && (c.__dirty & tn || !c.__isRendered) ? c.getPaintRect() : null;
d && h(d);
}
}
for (var f = this.__prevStartIndex; f < this.__prevEndIndex; ++f) {
var c = n[f], v = c && c.shouldBePainted(a, i, !0, !0);
if (c && (!v || !c.__zr) && c.__isRendered) {
var p = c.getPrevPaintRect();
p && h(p);
}
}
var g;
do {
g = !1;
for (var f = 0; f < o.length; ) {
if (o[f].isZero()) {
o.splice(f, 1);
continue;
}
for (var y = f + 1; y < o.length; )
o[f].intersect(o[y]) ? (g = !0, o[f].union(o[y]), o.splice(y, 1)) : y++;
f++;
}
} while (g);
return this._paintRects = o, o;
}, e.prototype.debugGetPaintRects = function() {
return (this._paintRects || []).slice();
}, e.prototype.resize = function(t, n) {
var a = this.dpr, i = this.dom, o = i.style, s = this.domBack;
o && (o.width = t + "px", o.height = n + "px"), i.width = t * a, i.height = n * a, s && (s.width = t * a, s.height = n * a, a !== 1 && this.ctxBack.scale(a, a));
}, e.prototype.clear = function(t, n, a) {
var i = this.dom, o = this.ctx, s = i.width, l = i.height;
n = n || this.clearColor;
var u = this.motionBlur && !t, h = this.lastFrameAlpha, f = this.dpr, c = this;
u && (this.domBack || this.createBackBuffer(), this.ctxBack.globalCompositeOperation = "copy", this.ctxBack.drawImage(i, 0, 0, s / f, l / f));
var v = this.domBack;
function p(d, g, y, m) {
if (o.clearRect(d, g, y, m), n && n !== "transparent") {
var _ = void 0;
if (Ef(n)) {
var S = n.global || n.__width === y && n.__height === m;
_ = S && n.__canvasGradient || Wd(o, n, {
x: 0,
y: 0,
width: y,
height: m
}), n.__canvasGradient = _, n.__width = y, n.__height = m;
} else IE(n) && (n.scaleX = n.scaleX || f, n.scaleY = n.scaleY || f, _ = $d(o, n, {
dirty: function() {
c.setUnpainted(), c.painter.refresh();
}
}));
o.save(), o.fillStyle = _ || n, o.fillRect(d, g, y, m), o.restore();
}
u && (o.save(), o.globalAlpha = h, o.drawImage(v, d, g, y, m), o.restore());
}
!a || u ? p(0, 0, s, l) : a.length && A(a, function(d) {
p(d.x * f, d.y * f, d.width * f, d.height * f);
});
}, e;
}(xr), pS = 1e5, Wa = 314159, Nu = 0.01, S5 = 1e-3;
function x5(r) {
return r ? r.__builtin__ ? !0 : !(typeof r.resize != "function" || typeof r.refresh != "function") : !1;
}
function b5(r, e) {
var t = document.createElement("div");
return t.style.cssText = [
"position:relative",
"width:" + r + "px",
"height:" + e + "px",
"padding:0",
"margin:0",
"border-width:0"
].join(";") + ";", t;
}
var w5 = function() {
function r(e, t, n, a) {
this.type = "canvas", this._zlevelList = [], this._prevDisplayList = [], this._layers = {}, this._layerConfig = {}, this._needsManuallyCompositing = !1, this.type = "canvas";
var i = !e.nodeName || e.nodeName.toUpperCase() === "CANVAS";
this._opts = n = B({}, n || {}), this.dpr = n.devicePixelRatio || Nh, this._singleCanvas = i, this.root = e;
var o = e.style;
o && (zT(e), e.innerHTML = ""), this.storage = t;
var s = this._zlevelList;
this._prevDisplayList = [];
var l = this._layers;
if (i) {
var h = e, f = h.width, c = h.height;
n.width != null && (f = n.width), n.height != null && (c = n.height), this.dpr = n.devicePixelRatio || 1, h.width = f * this.dpr, h.height = c * this.dpr, this._width = f, this._height = c;
var v = new Nv(h, this, this.dpr);
v.__builtin__ = !0, v.initContext(), l[Wa] = v, v.zlevel = Wa, s.push(Wa), this._domRoot = e;
} else {
this._width = go(e, 0, n), this._height = go(e, 1, n);
var u = this._domRoot = b5(this._width, this._height);
e.appendChild(u);
}
}
return r.prototype.getType = function() {
return "canvas";
}, r.prototype.isSingleCanvas = function() {
return this._singleCanvas;
}, r.prototype.getViewportRoot = function() {
return this._domRoot;
}, r.prototype.getViewportRootOffset = function() {
var e = this.getViewportRoot();
if (e)
return {
offsetLeft: e.offsetLeft || 0,
offsetTop: e.offsetTop || 0
};
}, r.prototype.refresh = function(e) {
var t = this.storage.getDisplayList(!0), n = this._prevDisplayList, a = this._zlevelList;
this._redrawId = Math.random(), this._paintList(t, n, e, this._redrawId);
for (var i = 0; i < a.length; i++) {
var o = a[i], s = this._layers[o];
if (!s.__builtin__ && s.refresh) {
var l = i === 0 ? this._backgroundColor : null;
s.refresh(l);
}
}
return this._opts.useDirtyRect && (this._prevDisplayList = t.slice()), this;
}, r.prototype.refreshHover = function() {
this._paintHoverList(this.storage.getDisplayList(!1));
}, r.prototype._paintHoverList = function(e) {
var t = e.length, n = this._hoverlayer;
if (n && n.clear(), !!t) {
for (var a = {
inHover: !0,
viewWidth: this._width,
viewHeight: this._height
}, i, o = 0; o < t; o++) {
var s = e[o];
s.__inHover && (n || (n = this._hoverlayer = this.getLayer(pS)), i || (i = n.ctx, i.save()), si(i, s, a, o === t - 1));
}
i && i.restore();
}
}, r.prototype.getHoverLayer = function() {
return this.getLayer(pS);
}, r.prototype.paintOne = function(e, t) {
pA(e, t);
}, r.prototype._paintList = function(e, t, n, a) {
if (this._redrawId === a) {
n = n || !1, this._updateLayerStatus(e);
var i = this._doPaintList(e, t, n), o = i.finished, s = i.needsRefreshHover;
if (this._needsManuallyCompositing && this._compositeManually(), s && this._paintHoverList(e), o)
this.eachLayer(function(u) {
u.afterBrush && u.afterBrush();
});
else {
var l = this;
Lh(function() {
l._paintList(e, t, n, a);
});
}
}
}, r.prototype._compositeManually = function() {
var e = this.getLayer(Wa).ctx, t = this._domRoot.width, n = this._domRoot.height;
e.clearRect(0, 0, t, n), this.eachBuiltinLayer(function(a) {
a.virtual && e.drawImage(a.dom, 0, 0, t, n);
});
}, r.prototype._doPaintList = function(e, t, n) {
for (var a = this, i = [], o = this._opts.useDirtyRect, s = 0; s < this._zlevelList.length; s++) {
var l = this._zlevelList[s], u = this._layers[l];
u.__builtin__ && u !== this._hoverlayer && (u.__dirty || n) && i.push(u);
}
for (var h = !0, f = !1, c = function(d) {
var g = i[d], y = g.ctx, m = o && g.createRepaintRects(e, t, v._width, v._height), _ = n ? g.__startIndex : g.__drawIndex, S = !n && g.incremental && Date.now, x = S && Date.now(), b = g.zlevel === v._zlevelList[0] ? v._backgroundColor : null;
if (g.__startIndex === g.__endIndex)
g.clear(!1, b, m);
else if (_ === g.__startIndex) {
var w = e[_];
(!w.incremental || !w.notClear || n) && g.clear(!1, b, m);
}
_ === -1 && (console.error("For some unknown reason. drawIndex is -1"), _ = g.__startIndex);
var T, C = function(L) {
var E = {
inHover: !1,
allClipped: !1,
prevEl: null,
viewWidth: a._width,
viewHeight: a._height
};
for (T = _; T < g.__endIndex; T++) {
var P = e[T];
if (P.__inHover && (f = !0), a._doPaintEl(P, g, o, L, E, T === g.__endIndex - 1), S) {
var k = Date.now() - x;
if (k > 15)
break;
}
}
E.prevElClipPaths && y.restore();
};
if (m)
if (m.length === 0)
T = g.__endIndex;
else
for (var D = v.dpr, M = 0; M < m.length; ++M) {
var I = m[M];
y.save(), y.beginPath(), y.rect(I.x * D, I.y * D, I.width * D, I.height * D), y.clip(), C(I), y.restore();
}
else
y.save(), C(), y.restore();
g.__drawIndex = T, g.__drawIndex < g.__endIndex && (h = !1);
}, v = this, p = 0; p < i.length; p++)
c(p);
return yt.wxa && A(this._layers, function(d) {
d && d.ctx && d.ctx.draw && d.ctx.draw();
}), {
finished: h,
needsRefreshHover: f
};
}, r.prototype._doPaintEl = function(e, t, n, a, i, o) {
var s = t.ctx;
if (n) {
var l = e.getPaintRect();
(!a || l && l.intersect(a)) && (si(s, e, i, o), e.setPrevPaintRect(l));
} else
si(s, e, i, o);
}, r.prototype.getLayer = function(e, t) {
this._singleCanvas && !this._needsManuallyCompositing && (e = Wa);
var n = this._layers[e];
return n || (n = new Nv("zr_" + e, this, this.dpr), n.zlevel = e, n.__builtin__ = !0, this._layerConfig[e] ? ht(n, this._layerConfig[e], !0) : this._layerConfig[e - Nu] && ht(n, this._layerConfig[e - Nu], !0), t && (n.virtual = t), this.insertLayer(e, n), n.initContext()), n;
}, r.prototype.insertLayer = function(e, t) {
var n = this._layers, a = this._zlevelList, i = a.length, o = this._domRoot, s = null, l = -1;
if (n[e]) {
process.env.NODE_ENV !== "production" && Er("ZLevel " + e + " has been used already");
return;
}
if (!x5(t)) {
process.env.NODE_ENV !== "production" && Er("Layer of zlevel " + e + " is not valid");
return;
}
if (i > 0 && e > a[0]) {
for (l = 0; l < i - 1 && !(a[l] < e && a[l + 1] > e); l++)
;
s = n[a[l]];
}
if (a.splice(l + 1, 0, e), n[e] = t, !t.virtual)
if (s) {
var u = s.dom;
u.nextSibling ? o.insertBefore(t.dom, u.nextSibling) : o.appendChild(t.dom);
} else
o.firstChild ? o.insertBefore(t.dom, o.firstChild) : o.appendChild(t.dom);
t.painter || (t.painter = this);
}, r.prototype.eachLayer = function(e, t) {
for (var n = this._zlevelList, a = 0; a < n.length; a++) {
var i = n[a];
e.call(t, this._layers[i], i);
}
}, r.prototype.eachBuiltinLayer = function(e, t) {
for (var n = this._zlevelList, a = 0; a < n.length; a++) {
var i = n[a], o = this._layers[i];
o.__builtin__ && e.call(t, o, i);
}
}, r.prototype.eachOtherLayer = function(e, t) {
for (var n = this._zlevelList, a = 0; a < n.length; a++) {
var i = n[a], o = this._layers[i];
o.__builtin__ || e.call(t, o, i);
}
}, r.prototype.getLayers = function() {
return this._layers;
}, r.prototype._updateLayerStatus = function(e) {
this.eachBuiltinLayer(function(f, c) {
f.__dirty = f.__used = !1;
});
function t(f) {
i && (i.__endIndex !== f && (i.__dirty = !0), i.__endIndex = f);
}
if (this._singleCanvas)
for (var n = 1; n < e.length; n++) {
var a = e[n];
if (a.zlevel !== e[n - 1].zlevel || a.incremental) {
this._needsManuallyCompositing = !0;
break;
}
}
var i = null, o = 0, s, l;
for (l = 0; l < e.length; l++) {
var a = e[l], u = a.zlevel, h = void 0;
s !== u && (s = u, o = 0), a.incremental ? (h = this.getLayer(u + S5, this._needsManuallyCompositing), h.incremental = !0, o = 1) : h = this.getLayer(u + (o > 0 ? Nu : 0), this._needsManuallyCompositing), h.__builtin__ || Er("ZLevel " + u + " has been used by unkown layer " + h.id), h !== i && (h.__used = !0, h.__startIndex !== l && (h.__dirty = !0), h.__startIndex = l, h.incremental ? h.__drawIndex = -1 : h.__drawIndex = l, t(l), i = h), a.__dirty & tn && !a.__inHover && (h.__dirty = !0, h.incremental && h.__drawIndex < 0 && (h.__drawIndex = l));
}
t(l), this.eachBuiltinLayer(function(f, c) {
!f.__used && f.getElementCount() > 0 && (f.__dirty = !0, f.__startIndex = f.__endIndex = f.__drawIndex = 0), f.__dirty && f.__drawIndex < 0 && (f.__drawIndex = f.__startIndex);
});
}, r.prototype.clear = function() {
return this.eachBuiltinLayer(this._clearLayer), this;
}, r.prototype._clearLayer = function(e) {
e.clear();
}, r.prototype.setBackgroundColor = function(e) {
this._backgroundColor = e, A(this._layers, function(t) {
t.setUnpainted();
});
}, r.prototype.configLayer = function(e, t) {
if (t) {
var n = this._layerConfig;
n[e] ? ht(n[e], t, !0) : n[e] = t;
for (var a = 0; a < this._zlevelList.length; a++) {
var i = this._zlevelList[a];
if (i === e || i === e + Nu) {
var o = this._layers[i];
ht(o, n[e], !0);
}
}
}
}, r.prototype.delLayer = function(e) {
var t = this._layers, n = this._zlevelList, a = t[e];
a && (a.dom.parentNode.removeChild(a.dom), delete t[e], n.splice(pt(n, e), 1));
}, r.prototype.resize = function(e, t) {
if (this._domRoot.style) {
var n = this._domRoot;
n.style.display = "none";
var a = this._opts, i = this.root;
if (e != null && (a.width = e), t != null && (a.height = t), e = go(i, 0, a), t = go(i, 1, a), n.style.display = "", this._width !== e || t !== this._height) {
n.style.width = e + "px", n.style.height = t + "px";
for (var o in this._layers)
this._layers.hasOwnProperty(o) && this._layers[o].resize(e, t);
this.refresh(!0);
}
this._width = e, this._height = t;
} else {
if (e == null || t == null)
return;
this._width = e, this._height = t, this.getLayer(Wa).resize(e, t);
}
return this;
}, r.prototype.clearLayer = function(e) {
var t = this._layers[e];
t && t.clear();
}, r.prototype.dispose = function() {
this.root.innerHTML = "", this.root = this.storage = this._domRoot = this._layers = null;
}, r.prototype.getRenderedCanvas = function(e) {
if (e = e || {}, this._singleCanvas && !this._compositeManually)
return this._layers[Wa].dom;
var t = new Nv("image", this, e.pixelRatio || this.dpr);
t.initContext(), t.clear(!1, e.backgroundColor || this._backgroundColor);
var n = t.ctx;
if (e.pixelRatio <= this.dpr) {
this.refresh();
var a = t.dom.width, i = t.dom.height;
this.eachLayer(function(f) {
f.__builtin__ ? n.drawImage(f.dom, 0, 0, a, i) : f.renderToCanvas && (n.save(), f.renderToCanvas(n), n.restore());
});
} else
for (var o = {
inHover: !1,
viewWidth: this._width,
viewHeight: this._height
}, s = this.storage.getDisplayList(!0), l = 0, u = s.length; l < u; l++) {
var h = s[l];
si(n, h, o, l === u - 1);
}
return t.dom;
}, r.prototype.getWidth = function() {
return this._width;
}, r.prototype.getHeight = function() {
return this._height;
}, r;
}();
function T5(r) {
r.registerPainter("canvas", w5);
}
var C5 = (
/** @class */
function(r) {
O(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t.type = e.type, t.hasSymbolVisual = !0, t;
}
return e.prototype.getInitialData = function(t) {
if (process.env.NODE_ENV !== "production") {
var n = t.coordinateSystem;
if (n !== "polar" && n !== "cartesian2d")
throw new Error("Line not support coordinateSystem besides cartesian and polar");
}
return On(null, this, {
useEncodeDefaulter: !0
});
}, e.prototype.getLegendIcon = function(t) {
var n = new at(), a = ae("line", 0, t.itemHeight / 2, t.itemWidth, 0, t.lineStyle.stroke, !1);
n.add(a), a.setStyle(t.lineStyle);
var i = this.getData().getVisual("symbol"), o = this.getData().getVisual("symbolRotate"), s = i === "none" ? "circle" : i, l = t.itemHeight * 0.8, u = ae(s, (t.itemWidth - l) / 2, (t.itemHeight - l) / 2, l, l, t.itemStyle.fill);
n.add(u), u.setStyle(t.itemStyle);
var h = t.iconRotate === "inherit" ? o : t.iconRotate || 0;
return u.rotation = h * Math.PI / 180, u.setOrigin([t.itemWidth / 2, t.itemHeight / 2]), s.indexOf("empty") > -1 && (u.style.stroke = u.style.fill, u.style.fill = "#fff", u.style.lineWidth = 2), n;
}, e.type = "series.line", e.dependencies = ["grid", "polar"], e.defaultOption = {
// zlevel: 0,
z: 3,
coordinateSystem: "cartesian2d",
legendHoverLink: !0,
clip: !0,
label: {
position: "top"
},
// itemStyle: {
// },
endLabel: {
show: !1,
valueAnimation: !0,
distance: 8
},
lineStyle: {
width: 2,
type: "solid"
},
emphasis: {
scale: !0
},
// areaStyle: {
// origin of areaStyle. Valid values:
// `'auto'/null/undefined`: from axisLine to data
// `'start'`: from min to data
// `'end'`: from data to max
// origin: 'auto'
// },
// false, 'start', 'end', 'middle'
step: !1,
// Disabled if step is true
smooth: !1,
smoothMonotone: null,
symbol: "emptyCircle",
symbolSize: 4,
symbolRotate: null,
showSymbol: !0,
// `false`: follow the label interval strategy.
// `true`: show all symbols.
// `'auto'`: If possible, show all symbols, otherwise
// follow the label interval strategy.
showAllSymbol: "auto",
// Whether to connect break point.
connectNulls: !1,
// Sampling for large data. Can be: 'average', 'max', 'min', 'sum', 'lttb'.
sampling: "none",
animationEasing: "linear",
// Disable progressive
progressive: 0,
hoverLayerThreshold: 1 / 0,
universalTransition: {
divideShape: "clone"
},
triggerLineEvent: !1
}, e;
}(Ft)
);
function Lo(r, e) {
var t = r.mapDimensionsAll("defaultedLabel"), n = t.length;
if (n === 1) {
var a = Ao(r, e, t[0]);
return a != null ? a + "" : null;
} else if (n) {
for (var i = [], o = 0; o < t.length; o++)
i.push(Ao(r, e, t[o]));
return i.join(" ");
}
}
function LM(r, e) {
var t = r.mapDimensionsAll("defaultedLabel");
if (!z(e))
return e + "";
for (var n = [], a = 0; a < t.length; a++) {
var i = r.getDimensionIndex(t[a]);
i >= 0 && n.push(e[i]);
}
return n.join(" ");
}
var Yl = (
/** @class */
function(r) {
O(e, r);
function e(t, n, a, i) {
var o = r.call(this) || this;
return o.updateData(t, n, a, i), o;
}
return e.prototype._createSymbol = function(t, n, a, i, o) {
this.removeAll();
var s = ae(t, -1, -1, 2, 2, null, o);
s.attr({
z2: 100,
culling: !0,
scaleX: i[0] / 2,
scaleY: i[1] / 2
}), s.drift = D5, this._symbolType = t, this.add(s);
}, e.prototype.stopSymbolAnimation = function(t) {
this.childAt(0).stopAnimation(null, t);
}, e.prototype.getSymbolType = function() {
return this._symbolType;
}, e.prototype.getSymbolPath = function() {
return this.childAt(0);
}, e.prototype.highlight = function() {
Mn(this.childAt(0));
}, e.prototype.downplay = function() {
In(this.childAt(0));
}, e.prototype.setZ = function(t, n) {
var a = this.childAt(0);
a.zlevel = t, a.z = n;
}, e.prototype.setDraggable = function(t, n) {
var a = this.childAt(0);
a.draggable = t, a.cursor = !n && t ? "move" : a.cursor;
}, e.prototype.updateData = function(t, n, a, i) {
this.silent = !1;
var o = t.getItemVisual(n, "symbol") || "circle", s = t.hostModel, l = e.getSymbolSize(t, n), u = o !== this._symbolType, h = i && i.disableAnimation;
if (u) {
var f = t.getItemVisual(n, "symbolKeepAspect");
this._createSymbol(o, t, n, l, f);
} else {
var c = this.childAt(0);
c.silent = !1;
var v = {
scaleX: l[0] / 2,
scaleY: l[1] / 2
};
h ? c.attr(v) : Ct(c, v, s, n), Or(c);
}
if (this._updateCommon(t, n, l, a, i), u) {
var c = this.childAt(0);
if (!h) {
var v = {
scaleX: this._sizeX,
scaleY: this._sizeY,
style: {
// Always fadeIn. Because it has fadeOut animation when symbol is removed..
opacity: c.style.opacity
}
};
c.scaleX = c.scaleY = 0, c.style.opacity = 0, $t(c, v, s, n);
}
}
h && this.childAt(0).stopAnimation("leave");
}, e.prototype._updateCommon = function(t, n, a, i, o) {
var s = this.childAt(0), l = t.hostModel, u, h, f, c, v, p, d, g, y;
if (i && (u = i.emphasisItemStyle, h = i.blurItemStyle, f = i.selectItemStyle, c = i.focus, v = i.blurScope, d = i.labelStatesModels, g = i.hoverScale, y = i.cursorStyle, p = i.emphasisDisabled), !i || t.hasItemOption) {
var m = i && i.itemModel ? i.itemModel : t.getItemModel(n), _ = m.getModel("emphasis");
u = _.getModel("itemStyle").getItemStyle(), f = m.getModel(["select", "itemStyle"]).getItemStyle(), h = m.getModel(["blur", "itemStyle"]).getItemStyle(), c = _.get("focus"), v = _.get("blurScope"), p = _.get("disabled"), d = ve(m), g = _.getShallow("scale"), y = m.getShallow("cursor");
}
var S = t.getItemVisual(n, "symbolRotate");
s.attr("rotation", (S || 0) * Math.PI / 180 || 0);
var x = ki(t.getItemVisual(n, "symbolOffset"), a);
x && (s.x = x[0], s.y = x[1]), y && s.attr("cursor", y);
var b = t.getItemVisual(n, "style"), w = b.fill;
if (s instanceof ge) {
var T = s.style;
s.useStyle(B({
// TODO other properties like x, y ?
image: T.image,
x: T.x,
y: T.y,
width: T.width,
height: T.height
}, b));
} else
s.__isEmptyBrush ? s.useStyle(B({}, b)) : s.useStyle(b), s.style.decal = null, s.setColor(w, o && o.symbolInnerColor), s.style.strokeNoScale = !0;
var C = t.getItemVisual(n, "liftZ"), D = this._z2;
C != null ? D == null && (this._z2 = s.z2, s.z2 += C) : D != null && (s.z2 = D, this._z2 = null);
var M = o && o.useNameLabel;
xe(s, d, {
labelFetcher: l,
labelDataIndex: n,
defaultText: I,
inheritColor: w,
defaultOpacity: b.opacity
});
function I(P) {
return M ? t.getName(P) : Lo(t, P);
}
this._sizeX = a[0] / 2, this._sizeY = a[1] / 2;
var L = s.ensureState("emphasis");
L.style = u, s.ensureState("select").style = f, s.ensureState("blur").style = h;
var E = g == null || g === !0 ? Math.max(1.1, 3 / this._sizeY) : isFinite(g) && g > 0 ? +g : 1;
L.scaleX = this._sizeX * E, L.scaleY = this._sizeY * E, this.setSymbolScale(1), Xt(this, c, v, p);
}, e.prototype.setSymbolScale = function(t) {
this.scaleX = this.scaleY = t;
}, e.prototype.fadeOut = function(t, n, a) {
var i = this.childAt(0), o = it(this).dataIndex, s = a && a.animation;
if (this.silent = i.silent = !0, a && a.fadeLabel) {
var l = i.getTextContent();
l && va(l, {
style: {
opacity: 0
}
}, n, {
dataIndex: o,
removeOpt: s,
cb: function() {
i.removeTextContent();
}
});
} else
i.removeTextContent();
va(i, {
style: {
opacity: 0
},
scaleX: 0,
scaleY: 0
}, n, {
dataIndex: o,
cb: t,
removeOpt: s
});
}, e.getSymbolSize = function(t, n) {
return qo(t.getItemVisual(n, "symbolSize"));
}, e;
}(at)
);
function D5(r, e) {
this.parent.drift(r, e);
}
function Ov(r, e, t, n) {
return e && !isNaN(e[0]) && !isNaN(e[1]) && !(n.isIgnore && n.isIgnore(t)) && !(n.clipShape && !n.clipShape.contain(e[0], e[1])) && r.getItemVisual(t, "symbol") !== "none";
}
function dS(r) {
return r != null && !J(r) && (r = {
isIgnore: r
}), r || {};
}
function gS(r) {
var e = r.hostModel, t = e.getModel("emphasis");
return {
emphasisItemStyle: t.getModel("itemStyle").getItemStyle(),
blurItemStyle: e.getModel(["blur", "itemStyle"]).getItemStyle(),
selectItemStyle: e.getModel(["select", "itemStyle"]).getItemStyle(),
focus: t.get("focus"),
blurScope: t.get("blurScope"),
emphasisDisabled: t.get("disabled"),
hoverScale: t.get("scale"),
labelStatesModels: ve(e),
cursorStyle: e.get("cursor")
};
}
var Zl = (
/** @class */
function() {
function r(e) {
this.group = new at(), this._SymbolCtor = e || Yl;
}
return r.prototype.updateData = function(e, t) {
this._progressiveEls = null, t = dS(t);
var n = this.group, a = e.hostModel, i = this._data, o = this._SymbolCtor, s = t.disableAnimation, l = gS(e), u = {
disableAnimation: s
}, h = t.getSymbolPoint || function(f) {
return e.getItemLayout(f);
};
i || n.removeAll(), e.diff(i).add(function(f) {
var c = h(f);
if (Ov(e, c, f, t)) {
var v = new o(e, f, l, u);
v.setPosition(c), e.setItemGraphicEl(f, v), n.add(v);
}
}).update(function(f, c) {
var v = i.getItemGraphicEl(c), p = h(f);
if (!Ov(e, p, f, t)) {
n.remove(v);
return;
}
var d = e.getItemVisual(f, "symbol") || "circle", g = v && v.getSymbolType && v.getSymbolType();
if (!v || g && g !== d)
n.remove(v), v = new o(e, f, l, u), v.setPosition(p);
else {
v.updateData(e, f, l, u);
var y = {
x: p[0],
y: p[1]
};
s ? v.attr(y) : Ct(v, y, a);
}
n.add(v), e.setItemGraphicEl(f, v);
}).remove(function(f) {
var c = i.getItemGraphicEl(f);
c && c.fadeOut(function() {
n.remove(c);
}, a);
}).execute(), this._getSymbolPoint = h, this._data = e;
}, r.prototype.updateLayout = function() {
var e = this, t = this._data;
t && t.eachItemGraphicEl(function(n, a) {
var i = e._getSymbolPoint(a);
n.setPosition(i), n.markRedraw();
});
}, r.prototype.incrementalPrepareUpdate = function(e) {
this._seriesScope = gS(e), this._data = null, this.group.removeAll();
}, r.prototype.incrementalUpdate = function(e, t, n) {
this._progressiveEls = [], n = dS(n);
function a(l) {
l.isGroup || (l.incremental = !0, l.ensureState("emphasis").hoverLayer = !0);
}
for (var i = e.start; i < e.end; i++) {
var o = t.getItemLayout(i);
if (Ov(t, o, i, n)) {
var s = new this._SymbolCtor(t, i, this._seriesScope);
s.traverse(a), s.setPosition(o), this.group.add(s), t.setItemGraphicEl(i, s), this._progressiveEls.push(s);
}
}
}, r.prototype.eachRendered = function(e) {
ma(this._progressiveEls || this.group, e);
}, r.prototype.remove = function(e) {
var t = this.group, n = this._data;
n && e ? n.eachItemGraphicEl(function(a) {
a.fadeOut(function() {
t.remove(a);
}, n.hostModel);
}) : t.removeAll();
}, r;
}()
);
function EM(r, e, t) {
var n = r.getBaseAxis(), a = r.getOtherAxis(n), i = A5(a, t), o = n.dim, s = a.dim, l = e.mapDimension(s), u = e.mapDimension(o), h = s === "x" || s === "radius" ? 1 : 0, f = G(r.dimensions, function(p) {
return e.mapDimension(p);
}), c = !1, v = e.getCalculationInfo("stackResultDimension");
return da(
e,
f[0]
/* , dims[1] */
) && (c = !0, f[0] = v), da(
e,
f[1]
/* , dims[0] */
) && (c = !0, f[1] = v), {
dataDimsForPoint: f,
valueStart: i,
valueAxisDim: s,
baseAxisDim: o,
stacked: !!c,
valueDim: l,
baseDim: u,
baseDataOffset: h,
stackedOverDimension: e.getCalculationInfo("stackedOverDimension")
};
}
function A5(r, e) {
var t = 0, n = r.scale.getExtent();
return e === "start" ? t = n[0] : e === "end" ? t = n[1] : Tt(e) && !isNaN(e) ? t = e : n[0] > 0 ? t = n[0] : n[1] < 0 && (t = n[1]), t;
}
function PM(r, e, t, n) {
var a = NaN;
r.stacked && (a = t.get(t.getCalculationInfo("stackedOverDimension"), n)), isNaN(a) && (a = r.valueStart);
var i = r.baseDataOffset, o = [];
return o[i] = t.get(r.baseDim, n), o[1 - i] = a, e.dataToPoint(o);
}
function M5(r, e) {
var t = [];
return e.diff(r).add(function(n) {
t.push({
cmd: "+",
idx: n
});
}).update(function(n, a) {
t.push({
cmd: "=",
idx: a,
idx1: n
});
}).remove(function(n) {
t.push({
cmd: "-",
idx: n
});
}).execute(), t;
}
function I5(r, e, t, n, a, i, o, s) {
for (var l = M5(r, e), u = [], h = [], f = [], c = [], v = [], p = [], d = [], g = EM(a, e, o), y = r.getLayout("points") || [], m = e.getLayout("points") || [], _ = 0; _ < l.length; _++) {
var S = l[_], x = !0, b = void 0, w = void 0;
switch (S.cmd) {
case "=":
b = S.idx * 2, w = S.idx1 * 2;
var T = y[b], C = y[b + 1], D = m[w], M = m[w + 1];
(isNaN(T) || isNaN(C)) && (T = D, C = M), u.push(T, C), h.push(D, M), f.push(t[b], t[b + 1]), c.push(n[w], n[w + 1]), d.push(e.getRawIndex(S.idx1));
break;
case "+":
var I = S.idx, L = g.dataDimsForPoint, E = a.dataToPoint([e.get(L[0], I), e.get(L[1], I)]);
w = I * 2, u.push(E[0], E[1]), h.push(m[w], m[w + 1]);
var P = PM(g, a, e, I);
f.push(P[0], P[1]), c.push(n[w], n[w + 1]), d.push(e.getRawIndex(I));
break;
case "-":
x = !1;
}
x && (v.push(S), p.push(p.length));
}
p.sort(function(st, Et) {
return d[st] - d[Et];
});
for (var k = u.length, N = Qr(k), R = Qr(k), V = Qr(k), F = Qr(k), H = [], _ = 0; _ < p.length; _++) {
var $ = p[_], j = _ * 2, Q = $ * 2;
N[j] = u[Q], N[j + 1] = u[Q + 1], R[j] = h[Q], R[j + 1] = h[Q + 1], V[j] = f[Q], V[j + 1] = f[Q + 1], F[j] = c[Q], F[j + 1] = c[Q + 1], H[_] = v[$];
}
return {
current: N,
next: R,
stackedOnCurrent: V,
stackedOnNext: F,
status: H
};
}
var $n = Math.min, Un = Math.max;
function gi(r, e) {
return isNaN(r) || isNaN(e);
}
function tg(r, e, t, n, a, i, o, s, l) {
for (var u, h, f, c, v, p, d = t, g = 0; g < n; g++) {
var y = e[d * 2], m = e[d * 2 + 1];
if (d >= a || d < 0)
break;
if (gi(y, m)) {
if (l) {
d += i;
continue;
}
break;
}
if (d === t)
r[i > 0 ? "moveTo" : "lineTo"](y, m), f = y, c = m;
else {
var _ = y - u, S = m - h;
if (_ * _ + S * S < 0.5) {
d += i;
continue;
}
if (o > 0) {
for (var x = d + i, b = e[x * 2], w = e[x * 2 + 1]; b === y && w === m && g < n; )
g++, x += i, d += i, b = e[x * 2], w = e[x * 2 + 1], y = e[d * 2], m = e[d * 2 + 1], _ = y - u, S = m - h;
var T = g + 1;
if (l)
for (; gi(b, w) && T < n; )
T++, x += i, b = e[x * 2], w = e[x * 2 + 1];
var C = 0.5, D = 0, M = 0, I = void 0, L = void 0;
if (T >= n || gi(b, w))
v = y, p = m;
else {
D = b - u, M = w - h;
var E = y - u, P = b - y, k = m - h, N = w - m, R = void 0, V = void 0;
if (s === "x") {
R = Math.abs(E), V = Math.abs(P);
var F = D > 0 ? 1 : -1;
v = y - F * R * o, p = m, I = y + F * V * o, L = m;
} else if (s === "y") {
R = Math.abs(k), V = Math.abs(N);
var H = M > 0 ? 1 : -1;
v = y, p = m - H * R * o, I = y, L = m + H * V * o;
} else
R = Math.sqrt(E * E + k * k), V = Math.sqrt(P * P + N * N), C = V / (V + R), v = y - D * o * (1 - C), p = m - M * o * (1 - C), I = y + D * o * C, L = m + M * o * C, I = $n(I, Un(b, y)), L = $n(L, Un(w, m)), I = Un(I, $n(b, y)), L = Un(L, $n(w, m)), D = I - y, M = L - m, v = y - D * R / V, p = m - M * R / V, v = $n(v, Un(u, y)), p = $n(p, Un(h, m)), v = Un(v, $n(u, y)), p = Un(p, $n(h, m)), D = y - v, M = m - p, I = y + D * V / R, L = m + M * V / R;
}
r.bezierCurveTo(f, c, v, p, y, m), f = I, c = L;
} else
r.lineTo(y, m);
}
u = y, h = m, d += i;
}
return g;
}
var kM = (
/** @class */
/* @__PURE__ */ function() {
function r() {
this.smooth = 0, this.smoothConstraint = !0;
}
return r;
}()
), L5 = (
/** @class */
function(r) {
O(e, r);
function e(t) {
var n = r.call(this, t) || this;
return n.type = "ec-polyline", n;
}
return e.prototype.getDefaultStyle = function() {
return {
stroke: "#000",
fill: null
};
}, e.prototype.getDefaultShape = function() {
return new kM();
}, e.prototype.buildPath = function(t, n) {
var a = n.points, i = 0, o = a.length / 2;
if (n.connectNulls) {
for (; o > 0 && gi(a[o * 2 - 2], a[o * 2 - 1]); o--)
;
for (; i < o && gi(a[i * 2], a[i * 2 + 1]); i++)
;
}
for (; i < o; )
i += tg(t, a, i, o, o, 1, n.smooth, n.smoothMonotone, n.connectNulls) + 1;
}, e.prototype.getPointOn = function(t, n) {
this.path || (this.createPathProxy(), this.buildPath(this.path, this.shape));
for (var a = this.path, i = a.data, o = sn.CMD, s, l, u = n === "x", h = [], f = 0; f < i.length; ) {
var c = i[f++], v = void 0, p = void 0, d = void 0, g = void 0, y = void 0, m = void 0, _ = void 0;
switch (c) {
case o.M:
s = i[f++], l = i[f++];
break;
case o.L:
if (v = i[f++], p = i[f++], _ = u ? (t - s) / (v - s) : (t - l) / (p - l), _ <= 1 && _ >= 0) {
var S = u ? (p - l) * _ + l : (v - s) * _ + s;
return u ? [t, S] : [S, t];
}
s = v, l = p;
break;
case o.C:
v = i[f++], p = i[f++], d = i[f++], g = i[f++], y = i[f++], m = i[f++];
var x = u ? Eh(s, v, d, y, t, h) : Eh(l, p, g, m, t, h);
if (x > 0)
for (var b = 0; b < x; b++) {
var w = h[b];
if (w <= 1 && w >= 0) {
var S = u ? ue(l, p, g, m, w) : ue(s, v, d, y, w);
return u ? [t, S] : [S, t];
}
}
s = y, l = m;
break;
}
}
}, e;
}(mt)
), E5 = (
/** @class */
function(r) {
O(e, r);
function e() {
return r !== null && r.apply(this, arguments) || this;
}
return e;
}(kM)
), RM = (
/** @class */
function(r) {
O(e, r);
function e(t) {
var n = r.call(this, t) || this;
return n.type = "ec-polygon", n;
}
return e.prototype.getDefaultShape = function() {
return new E5();
}, e.prototype.buildPath = function(t, n) {
var a = n.points, i = n.stackedOnPoints, o = 0, s = a.length / 2, l = n.smoothMonotone;
if (n.connectNulls) {
for (; s > 0 && gi(a[s * 2 - 2], a[s * 2 - 1]); s--)
;
for (; o < s && gi(a[o * 2], a[o * 2 + 1]); o++)
;
}
for (; o < s; ) {
var u = tg(t, a, o, s, s, 1, n.smooth, l, n.connectNulls);
tg(t, i, o + u - 1, u, s, -1, n.stackedOnSmooth, l, n.connectNulls), o += u + 1, t.closePath();
}
}, e;
}(mt)
);
function NM(r, e, t, n, a) {
var i = r.getArea(), o = i.x, s = i.y, l = i.width, u = i.height, h = t.get(["lineStyle", "width"]) || 0;
o -= h / 2, s -= h / 2, l += h, u += h, l = Math.ceil(l), o !== Math.floor(o) && (o = Math.floor(o), l++);
var f = new xt({
shape: {
x: o,
y: s,
width: l,
height: u
}
});
if (e) {
var c = r.getBaseAxis(), v = c.isHorizontal(), p = c.inverse;
v ? (p && (f.shape.x += l), f.shape.width = 0) : (p || (f.shape.y += u), f.shape.height = 0);
var d = K(a) ? function(g) {
a(g, f);
} : null;
$t(f, {
shape: {
width: l,
height: u,
x: o,
y: s
}
}, t, null, n, d);
}
return f;
}
function OM(r, e, t) {
var n = r.getArea(), a = jt(n.r0, 1), i = jt(n.r, 1), o = new Ge({
shape: {
cx: jt(r.cx, 1),
cy: jt(r.cy, 1),
r0: a,
r: i,
startAngle: n.startAngle,
endAngle: n.endAngle,
clockwise: n.clockwise
}
});
if (e) {
var s = r.getBaseAxis().dim === "angle";
s ? o.shape.endAngle = n.startAngle : o.shape.r = a, $t(o, {
shape: {
endAngle: n.endAngle,
r: i
}
}, t);
}
return o;
}
function Xl(r, e, t, n, a) {
if (r) {
if (r.type === "polar")
return OM(r, e, t);
if (r.type === "cartesian2d")
return NM(r, e, t, n, a);
} else return null;
return null;
}
function Ni(r, e) {
return r.type === e;
}
function yS(r, e) {
if (r.length === e.length) {
for (var t = 0; t < r.length; t++)
if (r[t] !== e[t])
return;
return !0;
}
}
function mS(r) {
for (var e = 1 / 0, t = 1 / 0, n = -1 / 0, a = -1 / 0, i = 0; i < r.length; ) {
var o = r[i++], s = r[i++];
isNaN(o) || (e = Math.min(o, e), n = Math.max(o, n)), isNaN(s) || (t = Math.min(s, t), a = Math.max(s, a));
}
return [[e, t], [n, a]];
}
function _S(r, e) {
var t = mS(r), n = t[0], a = t[1], i = mS(e), o = i[0], s = i[1];
return Math.max(Math.abs(n[0] - o[0]), Math.abs(n[1] - o[1]), Math.abs(a[0] - s[0]), Math.abs(a[1] - s[1]));
}
function SS(r) {
return Tt(r) ? r : r ? 0.5 : 0;
}
function P5(r, e, t) {
if (!t.valueDim)
return [];
for (var n = e.count(), a = Qr(n * 2), i = 0; i < n; i++) {
var o = PM(t, r, e, i);
a[i * 2] = o[0], a[i * 2 + 1] = o[1];
}
return a;
}
function Yn(r, e, t, n, a) {
var i = t.getBaseAxis(), o = i.dim === "x" || i.dim === "radius" ? 0 : 1, s = [], l = 0, u = [], h = [], f = [], c = [];
if (a) {
for (l = 0; l < r.length; l += 2) {
var v = e || r;
!isNaN(v[l]) && !isNaN(v[l + 1]) && c.push(r[l], r[l + 1]);
}
r = c;
}
for (l = 0; l < r.length - 2; l += 2)
switch (f[0] = r[l + 2], f[1] = r[l + 3], h[0] = r[l], h[1] = r[l + 1], s.push(h[0], h[1]), n) {
case "end":
u[o] = f[o], u[1 - o] = h[1 - o], s.push(u[0], u[1]);
break;
case "middle":
var p = (h[o] + f[o]) / 2, d = [];
u[o] = d[o] = p, u[1 - o] = h[1 - o], d[1 - o] = f[1 - o], s.push(u[0], u[1]), s.push(d[0], d[1]);
break;
default:
u[o] = h[o], u[1 - o] = f[1 - o], s.push(u[0], u[1]);
}
return s.push(r[l++], r[l++]), s;
}
function k5(r, e) {
var t = [], n = r.length, a, i;
function o(h, f, c) {
var v = h.coord, p = (c - v) / (f.coord - v), d = vP(p, [h.color, f.color]);
return {
coord: c,
color: d
};
}
for (var s = 0; s < n; s++) {
var l = r[s], u = l.coord;
if (u < 0)
a = l;
else if (u > e) {
i ? t.push(o(i, l, e)) : a && t.push(o(a, l, 0), o(a, l, e));
break;
} else
a && (t.push(o(a, l, 0)), a = null), t.push(l), i = l;
}
return t;
}
function R5(r, e, t) {
var n = r.getVisual("visualMeta");
if (!(!n || !n.length || !r.count())) {
if (e.type !== "cartesian2d") {
process.env.NODE_ENV !== "production" && console.warn("Visual map on line style is only supported on cartesian2d.");
return;
}
for (var a, i, o = n.length - 1; o >= 0; o--) {
var s = r.getDimensionInfo(n[o].dimension);
if (a = s && s.coordDim, a === "x" || a === "y") {
i = n[o];
break;
}
}
if (!i) {
process.env.NODE_ENV !== "production" && console.warn("Visual map on line style only support x or y dimension.");
return;
}
var l = e.getAxis(a), u = G(i.stops, function(_) {
return {
coord: l.toGlobalCoord(l.dataToCoord(_.value)),
color: _.color
};
}), h = u.length, f = i.outerColors.slice();
h && u[0].coord > u[h - 1].coord && (u.reverse(), f.reverse());
var c = k5(u, a === "x" ? t.getWidth() : t.getHeight()), v = c.length;
if (!v && h)
return u[0].coord < 0 ? f[1] ? f[1] : u[h - 1].color : f[0] ? f[0] : u[0].color;
var p = 10, d = c[0].coord - p, g = c[v - 1].coord + p, y = g - d;
if (y < 1e-3)
return "transparent";
A(c, function(_) {
_.offset = (_.coord - d) / y;
}), c.push({
// NOTE: inRangeStopLen may still be 0 if stoplen is zero.
offset: v ? c[v - 1].offset : 0.5,
color: f[1] || "transparent"
}), c.unshift({
offset: v ? c[0].offset : 0.5,
color: f[0] || "transparent"
});
var m = new Gl(0, 0, 0, 0, c, !0);
return m[a] = d, m[a + "2"] = g, m;
}
}
function N5(r, e, t) {
var n = r.get("showAllSymbol"), a = n === "auto";
if (!(n && !a)) {
var i = t.getAxesByScale("ordinal")[0];
if (i && !(a && O5(i, e))) {
var o = e.mapDimension(i.dim), s = {};
return A(i.getViewLabels(), function(l) {
var u = i.scale.getRawOrdinalNumber(l.tickValue);
s[u] = 1;
}), function(l) {
return !s.hasOwnProperty(e.get(o, l));
};
}
}
}
function O5(r, e) {
var t = r.getExtent(), n = Math.abs(t[1] - t[0]) / r.scale.count();
isNaN(n) && (n = 0);
for (var a = e.count(), i = Math.max(1, Math.round(a / 5)), o = 0; o < a; o += i)
if (Yl.getSymbolSize(
e,
o
// Only for cartesian, where `isHorizontal` exists.
)[r.isHorizontal() ? 1 : 0] * 1.5 > n)
return !1;
return !0;
}
function V5(r, e) {
return isNaN(r) || isNaN(e);
}
function B5(r) {
for (var e = r.length / 2; e > 0 && V5(r[e * 2 - 2], r[e * 2 - 1]); e--)
;
return e - 1;
}
function xS(r, e) {
return [r[e * 2], r[e * 2 + 1]];
}
function z5(r, e, t) {
for (var n = r.length / 2, a = t === "x" ? 0 : 1, i, o, s = 0, l = -1, u = 0; u < n; u++)
if (o = r[u * 2 + a], !(isNaN(o) || isNaN(r[u * 2 + 1 - a]))) {
if (u === 0) {
i = o;
continue;
}
if (i <= e && o >= e || i >= e && o <= e) {
l = u;
break;
}
s = u, i = o;
}
return {
range: [s, l],
t: (e - i) / (o - i)
};
}
function VM(r) {
if (r.get(["endLabel", "show"]))
return !0;
for (var e = 0; e < ze.length; e++)
if (r.get([ze[e], "endLabel", "show"]))
return !0;
return !1;
}
function Vv(r, e, t, n) {
if (Ni(e, "cartesian2d")) {
var a = n.getModel("endLabel"), i = a.get("valueAnimation"), o = n.getData(), s = {
lastFrameIndex: 0
}, l = VM(n) ? function(v, p) {
r._endLabelOnDuring(v, p, o, s, i, a, e);
} : null, u = e.getBaseAxis().isHorizontal(), h = NM(e, t, n, function() {
var v = r._endLabel;
v && t && s.originalX != null && v.attr({
x: s.originalX,
y: s.originalY
});
}, l);
if (!n.get("clip", !0)) {
var f = h.shape, c = Math.max(f.width, f.height);
u ? (f.y -= c, f.height += c * 2) : (f.x -= c, f.width += c * 2);
}
return l && l(1, h), h;
} else
return process.env.NODE_ENV !== "production" && n.get(["endLabel", "show"]) && console.warn("endLabel is not supported for lines in polar systems."), OM(e, t, n);
}
function G5(r, e) {
var t = e.getBaseAxis(), n = t.isHorizontal(), a = t.inverse, i = n ? a ? "right" : "left" : "center", o = n ? "middle" : a ? "top" : "bottom";
return {
normal: {
align: r.get("align") || i,
verticalAlign: r.get("verticalAlign") || o
}
};
}
var F5 = (
/** @class */
function(r) {
O(e, r);
function e() {
return r !== null && r.apply(this, arguments) || this;
}
return e.prototype.init = function() {
var t = new at(), n = new Zl();
this.group.add(n.group), this._symbolDraw = n, this._lineGroup = t, this._changePolyState = Y(this._changePolyState, this);
}, e.prototype.render = function(t, n, a) {
var i = t.coordinateSystem, o = this.group, s = t.getData(), l = t.getModel("lineStyle"), u = t.getModel("areaStyle"), h = s.getLayout("points") || [], f = i.type === "polar", c = this._coordSys, v = this._symbolDraw, p = this._polyline, d = this._polygon, g = this._lineGroup, y = !n.ssr && t.get("animation"), m = !u.isEmpty(), _ = u.get("origin"), S = EM(i, s, _), x = m && P5(i, s, S), b = t.get("showSymbol"), w = t.get("connectNulls"), T = b && !f && N5(t, s, i), C = this._data;
C && C.eachItemGraphicEl(function(st, Et) {
st.__temp && (o.remove(st), C.setItemGraphicEl(Et, null));
}), b || v.remove(), o.add(g);
var D = f ? !1 : t.get("step"), M;
i && i.getArea && t.get("clip", !0) && (M = i.getArea(), M.width != null ? (M.x -= 0.1, M.y -= 0.1, M.width += 0.2, M.height += 0.2) : M.r0 && (M.r0 -= 0.5, M.r += 0.5)), this._clipShapeForSymbol = M;
var I = R5(s, i, a) || s.getVisual("style")[s.getVisual("drawType")];
if (!(p && c.type === i.type && D === this._step))
b && v.updateData(s, {
isIgnore: T,
clipShape: M,
disableAnimation: !0,
getSymbolPoint: function(st) {
return [h[st * 2], h[st * 2 + 1]];
}
}), y && this._initSymbolLabelAnimation(s, i, M), D && (x && (x = Yn(x, h, i, D, w)), h = Yn(h, null, i, D, w)), p = this._newPolyline(h), m ? d = this._newPolygon(h, x) : d && (g.remove(d), d = this._polygon = null), f || this._initOrUpdateEndLabel(t, i, Ci(I)), g.setClipPath(Vv(this, i, !0, t));
else {
m && !d ? d = this._newPolygon(h, x) : d && !m && (g.remove(d), d = this._polygon = null), f || this._initOrUpdateEndLabel(t, i, Ci(I));
var L = g.getClipPath();
if (L) {
var E = Vv(this, i, !1, t);
$t(L, {
shape: E.shape
}, t);
} else
g.setClipPath(Vv(this, i, !0, t));
b && v.updateData(s, {
isIgnore: T,
clipShape: M,
disableAnimation: !0,
getSymbolPoint: function(st) {
return [h[st * 2], h[st * 2 + 1]];
}
}), (!yS(this._stackedOnPoints, x) || !yS(this._points, h)) && (y ? this._doUpdateAnimation(s, x, i, a, D, _, w) : (D && (x && (x = Yn(x, h, i, D, w)), h = Yn(h, null, i, D, w)), p.setShape({
points: h
}), d && d.setShape({
points: h,
stackedOnPoints: x
})));
}
var P = t.getModel("emphasis"), k = P.get("focus"), N = P.get("blurScope"), R = P.get("disabled");
if (p.useStyle(et(
// Use color in lineStyle first
l.getLineStyle(),
{
fill: "none",
stroke: I,
lineJoin: "bevel"
}
)), Se(p, t, "lineStyle"), p.style.lineWidth > 0 && t.get(["emphasis", "lineStyle", "width"]) === "bolder") {
var V = p.getState("emphasis").style;
V.lineWidth = +p.style.lineWidth + 1;
}
it(p).seriesIndex = t.seriesIndex, Xt(p, k, N, R);
var F = SS(t.get("smooth")), H = t.get("smoothMonotone");
if (p.setShape({
smooth: F,
smoothMonotone: H,
connectNulls: w
}), d) {
var $ = s.getCalculationInfo("stackedOnSeries"), j = 0;
d.useStyle(et(u.getAreaStyle(), {
fill: I,
opacity: 0.7,
lineJoin: "bevel",
decal: s.getVisual("style").decal
})), $ && (j = SS($.get("smooth"))), d.setShape({
smooth: F,
stackedOnSmooth: j,
smoothMonotone: H,
connectNulls: w
}), Se(d, t, "areaStyle"), it(d).seriesIndex = t.seriesIndex, Xt(d, k, N, R);
}
var Q = this._changePolyState;
s.eachItemGraphicEl(function(st) {
st && (st.onHoverStateChange = Q);
}), this._polyline.onHoverStateChange = Q, this._data = s, this._coordSys = i, this._stackedOnPoints = x, this._points = h, this._step = D, this._valueOrigin = _, t.get("triggerLineEvent") && (this.packEventData(t, p), d && this.packEventData(t, d));
}, e.prototype.packEventData = function(t, n) {
it(n).eventData = {
componentType: "series",
componentSubType: "line",
componentIndex: t.componentIndex,
seriesIndex: t.seriesIndex,
seriesName: t.name,
seriesType: "line"
};
}, e.prototype.highlight = function(t, n, a, i) {
var o = t.getData(), s = bi(o, i);
if (this._changePolyState("emphasis"), !(s instanceof Array) && s != null && s >= 0) {
var l = o.getLayout("points"), u = o.getItemGraphicEl(s);
if (!u) {
var h = l[s * 2], f = l[s * 2 + 1];
if (isNaN(h) || isNaN(f) || this._clipShapeForSymbol && !this._clipShapeForSymbol.contain(h, f))
return;
var c = t.get("zlevel") || 0, v = t.get("z") || 0;
u = new Yl(o, s), u.x = h, u.y = f, u.setZ(c, v);
var p = u.getSymbolPath().getTextContent();
p && (p.zlevel = c, p.z = v, p.z2 = this._polyline.z2 + 1), u.__temp = !0, o.setItemGraphicEl(s, u), u.stopSymbolAnimation(!0), this.group.add(u);
}
u.highlight();
} else
kt.prototype.highlight.call(this, t, n, a, i);
}, e.prototype.downplay = function(t, n, a, i) {
var o = t.getData(), s = bi(o, i);
if (this._changePolyState("normal"), s != null && s >= 0) {
var l = o.getItemGraphicEl(s);
l && (l.__temp ? (o.setItemGraphicEl(s, null), this.group.remove(l)) : l.downplay());
} else
kt.prototype.downplay.call(this, t, n, a, i);
}, e.prototype._changePolyState = function(t) {
var n = this._polygon;
Bh(this._polyline, t), n && Bh(n, t);
}, e.prototype._newPolyline = function(t) {
var n = this._polyline;
return n && this._lineGroup.remove(n), n = new L5({
shape: {
points: t
},
segmentIgnoreThreshold: 2,
z2: 10
}), this._lineGroup.add(n), this._polyline = n, n;
}, e.prototype._newPolygon = function(t, n) {
var a = this._polygon;
return a && this._lineGroup.remove(a), a = new RM({
shape: {
points: t,
stackedOnPoints: n
},
segmentIgnoreThreshold: 2
}), this._lineGroup.add(a), this._polygon = a, a;
}, e.prototype._initSymbolLabelAnimation = function(t, n, a) {
var i, o, s = n.getBaseAxis(), l = s.inverse;
n.type === "cartesian2d" ? (i = s.isHorizontal(), o = !1) : n.type === "polar" && (i = s.dim === "angle", o = !0);
var u = t.hostModel, h = u.get("animationDuration");
K(h) && (h = h(null));
var f = u.get("animationDelay") || 0, c = K(f) ? f(null) : f;
t.eachItemGraphicEl(function(v, p) {
var d = v;
if (d) {
var g = [v.x, v.y], y = void 0, m = void 0, _ = void 0;
if (a)
if (o) {
var S = a, x = n.pointToCoord(g);
i ? (y = S.startAngle, m = S.endAngle, _ = -x[1] / 180 * Math.PI) : (y = S.r0, m = S.r, _ = x[0]);
} else {
var b = a;
i ? (y = b.x, m = b.x + b.width, _ = v.x) : (y = b.y + b.height, m = b.y, _ = v.y);
}
var w = m === y ? 0 : (_ - y) / (m - y);
l && (w = 1 - w);
var T = K(f) ? f(p) : h * w + c, C = d.getSymbolPath(), D = C.getTextContent();
d.attr({
scaleX: 0,
scaleY: 0
}), d.animateTo({
scaleX: 1,
scaleY: 1
}, {
duration: 200,
setToFinal: !0,
delay: T
}), D && D.animateFrom({
style: {
opacity: 0
}
}, {
duration: 300,
delay: T
}), C.disableLabelAnimation = !0;
}
});
}, e.prototype._initOrUpdateEndLabel = function(t, n, a) {
var i = t.getModel("endLabel");
if (VM(t)) {
var o = t.getData(), s = this._polyline, l = o.getLayout("points");
if (!l) {
s.removeTextContent(), this._endLabel = null;
return;
}
var u = this._endLabel;
u || (u = this._endLabel = new wt({
z2: 200
// should be higher than item symbol
}), u.ignoreClip = !0, s.setTextContent(this._endLabel), s.disableLabelAnimation = !0);
var h = B5(l);
h >= 0 && (xe(s, ve(t, "endLabel"), {
inheritColor: a,
labelFetcher: t,
labelDataIndex: h,
defaultText: function(f, c, v) {
return v != null ? LM(o, v) : Lo(o, f);
},
enableTextSetter: !0
}, G5(i, n)), s.textConfig.position = null);
} else this._endLabel && (this._polyline.removeTextContent(), this._endLabel = null);
}, e.prototype._endLabelOnDuring = function(t, n, a, i, o, s, l) {
var u = this._endLabel, h = this._polyline;
if (u) {
t < 1 && i.originalX == null && (i.originalX = u.x, i.originalY = u.y);
var f = a.getLayout("points"), c = a.hostModel, v = c.get("connectNulls"), p = s.get("precision"), d = s.get("distance") || 0, g = l.getBaseAxis(), y = g.isHorizontal(), m = g.inverse, _ = n.shape, S = m ? y ? _.x : _.y + _.height : y ? _.x + _.width : _.y, x = (y ? d : 0) * (m ? -1 : 1), b = (y ? 0 : -d) * (m ? -1 : 1), w = y ? "x" : "y", T = z5(f, S, w), C = T.range, D = C[1] - C[0], M = void 0;
if (D >= 1) {
if (D > 1 && !v) {
var I = xS(f, C[0]);
u.attr({
x: I[0] + x,
y: I[1] + b
}), o && (M = c.getRawValue(C[0]));
} else {
var I = h.getPointOn(S, w);
I && u.attr({
x: I[0] + x,
y: I[1] + b
});
var L = c.getRawValue(C[0]), E = c.getRawValue(C[1]);
o && (M = wC(a, p, L, E, T.t));
}
i.lastFrameIndex = C[0];
} else {
var P = t === 1 || i.lastFrameIndex > 0 ? C[0] : 0, I = xS(f, P);
o && (M = c.getRawValue(P)), u.attr({
x: I[0] + x,
y: I[1] + b
});
}
if (o) {
var k = Fo(u);
typeof k.setLabelText == "function" && k.setLabelText(M);
}
}
}, e.prototype._doUpdateAnimation = function(t, n, a, i, o, s, l) {
var u = this._polyline, h = this._polygon, f = t.hostModel, c = I5(this._data, t, this._stackedOnPoints, n, this._coordSys, a, this._valueOrigin), v = c.current, p = c.stackedOnCurrent, d = c.next, g = c.stackedOnNext;
if (o && (p = Yn(c.stackedOnCurrent, c.current, a, o, l), v = Yn(c.current, null, a, o, l), g = Yn(c.stackedOnNext, c.next, a, o, l), d = Yn(c.next, null, a, o, l)), _S(v, d) > 3e3 || h && _S(p, g) > 3e3) {
u.stopAnimation(), u.setShape({
points: d
}), h && (h.stopAnimation(), h.setShape({
points: d,
stackedOnPoints: g
}));
return;
}
u.shape.__points = c.current, u.shape.points = v;
var y = {
shape: {
points: d
}
};
c.current !== v && (y.shape.__points = c.next), u.stopAnimation(), Ct(u, y, f), h && (h.setShape({
// Reuse the points with polyline.
points: v,
stackedOnPoints: p
}), h.stopAnimation(), Ct(h, {
shape: {
stackedOnPoints: g
}
}, f), u.shape.points !== h.shape.points && (h.shape.points = u.shape.points));
for (var m = [], _ = c.status, S = 0; S < _.length; S++) {
var x = _[S].cmd;
if (x === "=") {
var b = t.getItemGraphicEl(_[S].idx1);
b && m.push({
el: b,
ptIdx: S
// Index of points
});
}
}
u.animators && u.animators.length && u.animators[0].during(function() {
h && h.dirtyShape();
for (var w = u.shape.__points, T = 0; T < m.length; T++) {
var C = m[T].el, D = m[T].ptIdx * 2;
C.x = w[D], C.y = w[D + 1], C.markRedraw();
}
});
}, e.prototype.remove = function(t) {
var n = this.group, a = this._data;
this._lineGroup.removeAll(), this._symbolDraw.remove(!0), a && a.eachItemGraphicEl(function(i, o) {
i.__temp && (n.remove(i), a.setItemGraphicEl(o, null));
}), this._polyline = this._polygon = this._coordSys = this._points = this._stackedOnPoints = this._endLabel = this._data = null;
}, e.type = "line", e;
}(kt)
);
function ql(r, e) {
return {
seriesType: r,
plan: Zo(),
reset: function(t) {
var n = t.getData(), a = t.coordinateSystem, i = t.pipelineContext, o = e || i.large;
if (a) {
var s = G(a.dimensions, function(v) {
return n.mapDimension(v);
}).slice(0, 2), l = s.length, u = n.getCalculationInfo("stackResultDimension");
da(n, s[0]) && (s[0] = u), da(n, s[1]) && (s[1] = u);
var h = n.getStore(), f = n.getDimensionIndex(s[0]), c = n.getDimensionIndex(s[1]);
return l && {
progress: function(v, p) {
for (var d = v.end - v.start, g = o && Qr(d * l), y = [], m = [], _ = v.start, S = 0; _ < v.end; _++) {
var x = void 0;
if (l === 1) {
var b = h.get(f, _);
x = a.dataToPoint(b, null, m);
} else
y[0] = h.get(f, _), y[1] = h.get(c, _), x = a.dataToPoint(y, null, m);
o ? (g[S++] = x[0], g[S++] = x[1]) : p.setItemLayout(_, x.slice());
}
o && p.setLayout("points", g);
}
};
}
}
};
}
var H5 = {
average: function(r) {
for (var e = 0, t = 0, n = 0; n < r.length; n++)
isNaN(r[n]) || (e += r[n], t++);
return t === 0 ? NaN : e / t;
},
sum: function(r) {
for (var e = 0, t = 0; t < r.length; t++)
e += r[t] || 0;
return e;
},
max: function(r) {
for (var e = -1 / 0, t = 0; t < r.length; t++)
r[t] > e && (e = r[t]);
return isFinite(e) ? e : NaN;
},
min: function(r) {
for (var e = 1 / 0, t = 0; t < r.length; t++)
r[t] < e && (e = r[t]);
return isFinite(e) ? e : NaN;
},
// TODO
// Median
nearest: function(r) {
return r[0];
}
}, W5 = function(r) {
return Math.round(r.length / 2);
};
function BM(r) {
return {
seriesType: r,
// FIXME:TS never used, so comment it
// modifyOutputEnd: true,
reset: function(e, t, n) {
var a = e.getData(), i = e.get("sampling"), o = e.coordinateSystem, s = a.count();
if (s > 10 && o.type === "cartesian2d" && i) {
var l = o.getBaseAxis(), u = o.getOtherAxis(l), h = l.getExtent(), f = n.getDevicePixelRatio(), c = Math.abs(h[1] - h[0]) * (f || 1), v = Math.round(s / c);
if (isFinite(v) && v > 1) {
i === "lttb" ? e.setData(a.lttbDownSample(a.mapDimension(u.dim), 1 / v)) : i === "minmax" && e.setData(a.minmaxDownSample(a.mapDimension(u.dim), 1 / v));
var p = void 0;
U(i) ? p = H5[i] : K(i) && (p = i), p && e.setData(a.downSample(a.mapDimension(u.dim), 1 / v, p, W5));
}
}
}
};
}
function $5(r) {
r.registerChartView(F5), r.registerSeriesModel(C5), r.registerLayout(ql("line", !0)), r.registerVisual({
seriesType: "line",
reset: function(e) {
var t = e.getData(), n = e.getModel("lineStyle").getLineStyle();
n && !n.stroke && (n.stroke = t.getVisual("style").fill), t.setVisual("legendLineStyle", n);
}
}), r.registerProcessor(r.PRIORITY.PROCESSOR.STATISTIC, BM("line"));
}
var bl = (
/** @class */
function(r) {
O(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t.type = e.type, t;
}
return e.prototype.getInitialData = function(t, n) {
return On(null, this, {
useEncodeDefaulter: !0
});
}, e.prototype.getMarkerPosition = function(t, n, a) {
var i = this.coordinateSystem;
if (i && i.clampData) {
var o = i.clampData(t), s = i.dataToPoint(o);
if (a)
A(i.getAxes(), function(c, v) {
if (c.type === "category" && n != null) {
var p = c.getTicksCoords(), d = c.getTickModel().get("alignWithLabel"), g = o[v], y = n[v] === "x1" || n[v] === "y1";
if (y && !d && (g += 1), p.length < 2)
return;
if (p.length === 2) {
s[v] = c.toGlobalCoord(c.getExtent()[y ? 1 : 0]);
return;
}
for (var m = void 0, _ = void 0, S = 1, x = 0; x < p.length; x++) {
var b = p[x].coord, w = x === p.length - 1 ? p[x - 1].tickValue + S : p[x].tickValue;
if (w === g) {
_ = b;
break;
} else if (w < g)
m = b;
else if (m != null && w > g) {
_ = (b + m) / 2;
break;
}
x === 1 && (S = w - p[0].tickValue);
}
_ == null && (m ? m && (_ = p[p.length - 1].coord) : _ = p[0].coord), s[v] = c.toGlobalCoord(_);
}
});
else {
var l = this.getData(), u = l.getLayout("offset"), h = l.getLayout("size"), f = i.getBaseAxis().isHorizontal() ? 0 : 1;
s[f] += u + h / 2;
}
return s;
}
return [NaN, NaN];
}, e.type = "series.__base_bar__", e.defaultOption = {
// zlevel: 0,
z: 2,
coordinateSystem: "cartesian2d",
legendHoverLink: !0,
// stack: null
// Cartesian coordinate system
// xAxisIndex: 0,
// yAxisIndex: 0,
barMinHeight: 0,
barMinAngle: 0,
// cursor: null,
large: !1,
largeThreshold: 400,
progressive: 3e3,
progressiveChunkMode: "mod"
}, e;
}(Ft)
);
Ft.registerClass(bl);
var U5 = (
/** @class */
function(r) {
O(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t.type = e.type, t;
}
return e.prototype.getInitialData = function() {
return On(null, this, {
useEncodeDefaulter: !0,
createInvertedIndices: !!this.get("realtimeSort", !0) || null
});
}, e.prototype.getProgressive = function() {
return this.get("large") ? this.get("progressive") : !1;
}, e.prototype.getProgressiveThreshold = function() {
var t = this.get("progressiveThreshold"), n = this.get("largeThreshold");
return n > t && (t = n), t;
}, e.prototype.brushSelector = function(t, n, a) {
return a.rect(n.getItemLayout(t));
}, e.type = "series.bar", e.dependencies = ["grid", "polar"], e.defaultOption = _a(bl.defaultOption, {
// If clipped
// Only available on cartesian2d
clip: !0,
roundCap: !1,
showBackground: !1,
backgroundStyle: {
color: "rgba(180, 180, 180, 0.2)",
borderColor: null,
borderWidth: 0,
borderType: "solid",
borderRadius: 0,
shadowBlur: 0,
shadowColor: null,
shadowOffsetX: 0,
shadowOffsetY: 0,
opacity: 1
},
select: {
itemStyle: {
borderColor: "#212121"
}
},
realtimeSort: !1
}), e;
}(bl)
), Y5 = (
/** @class */
/* @__PURE__ */ function() {
function r() {
this.cx = 0, this.cy = 0, this.r0 = 0, this.r = 0, this.startAngle = 0, this.endAngle = Math.PI * 2, this.clockwise = !0;
}
return r;
}()
), of = (
/** @class */
function(r) {
O(e, r);
function e(t) {
var n = r.call(this, t) || this;
return n.type = "sausage", n;
}
return e.prototype.getDefaultShape = function() {
return new Y5();
}, e.prototype.buildPath = function(t, n) {
var a = n.cx, i = n.cy, o = Math.max(n.r0 || 0, 0), s = Math.max(n.r, 0), l = (s - o) * 0.5, u = o + l, h = n.startAngle, f = n.endAngle, c = n.clockwise, v = Math.PI * 2, p = c ? f - h < v : h - f < v;
p || (h = f - (c ? v : -v));
var d = Math.cos(h), g = Math.sin(h), y = Math.cos(f), m = Math.sin(f);
p ? (t.moveTo(d * o + a, g * o + i), t.arc(d * u + a, g * u + i, l, -Math.PI + h, h, !c)) : t.moveTo(d * s + a, g * s + i), t.arc(a, i, s, h, f, !c), t.arc(y * u + a, m * u + i, l, f - Math.PI * 2, f - Math.PI, !c), o !== 0 && t.arc(a, i, o, f, h, c);
}, e;
}(mt)
);
function Z5(r, e) {
e = e || {};
var t = e.isRoundCap;
return function(n, a, i) {
var o = a.position;
if (!o || o instanceof Array)
return Oh(n, a, i);
var s = r(o), l = a.distance != null ? a.distance : 5, u = this.shape, h = u.cx, f = u.cy, c = u.r, v = u.r0, p = (c + v) / 2, d = u.startAngle, g = u.endAngle, y = (d + g) / 2, m = t ? Math.abs(c - v) / 2 : 0, _ = Math.cos, S = Math.sin, x = h + c * _(d), b = f + c * S(d), w = "left", T = "top";
switch (s) {
case "startArc":
x = h + (v - l) * _(y), b = f + (v - l) * S(y), w = "center", T = "top";
break;
case "insideStartArc":
x = h + (v + l) * _(y), b = f + (v + l) * S(y), w = "center", T = "bottom";
break;
case "startAngle":
x = h + p * _(d) + Ou(d, l + m, !1), b = f + p * S(d) + Vu(d, l + m, !1), w = "right", T = "middle";
break;
case "insideStartAngle":
x = h + p * _(d) + Ou(d, -l + m, !1), b = f + p * S(d) + Vu(d, -l + m, !1), w = "left", T = "middle";
break;
case "middle":
x = h + p * _(y), b = f + p * S(y), w = "center", T = "middle";
break;
case "endArc":
x = h + (c + l) * _(y), b = f + (c + l) * S(y), w = "center", T = "bottom";
break;
case "insideEndArc":
x = h + (c - l) * _(y), b = f + (c - l) * S(y), w = "center", T = "top";
break;
case "endAngle":
x = h + p * _(g) + Ou(g, l + m, !0), b = f + p * S(g) + Vu(g, l + m, !0), w = "left", T = "middle";
break;
case "insideEndAngle":
x = h + p * _(g) + Ou(g, -l + m, !0), b = f + p * S(g) + Vu(g, -l + m, !0), w = "right", T = "middle";
break;
default:
return Oh(n, a, i);
}
return n = n || {}, n.x = x, n.y = b, n.align = w, n.verticalAlign = T, n;
};
}
function X5(r, e, t, n) {
if (Tt(n)) {
r.setTextConfig({
rotation: n
});
return;
} else if (z(e)) {
r.setTextConfig({
rotation: 0
});
return;
}
var a = r.shape, i = a.clockwise ? a.startAngle : a.endAngle, o = a.clockwise ? a.endAngle : a.startAngle, s = (i + o) / 2, l, u = t(e);
switch (u) {
case "startArc":
case "insideStartArc":
case "middle":
case "insideEndArc":
case "endArc":
l = s;
break;
case "startAngle":
case "insideStartAngle":
l = i;
break;
case "endAngle":
case "insideEndAngle":
l = o;
break;
default:
r.setTextConfig({
rotation: 0
});
return;
}
var h = Math.PI * 1.5 - l;
u === "middle" && h > Math.PI / 2 && h < Math.PI * 1.5 && (h -= Math.PI), r.setTextConfig({
rotation: h
});
}
function Ou(r, e, t) {
return e * Math.sin(r) * (t ? -1 : 1);
}
function Vu(r, e, t) {
return e * Math.cos(r) * (t ? 1 : -1);
}
function li(r, e, t) {
var n = r.get("borderRadius");
if (n == null)
return t ? {
cornerRadius: 0
} : null;
z(n) || (n = [n, n, n, n]);
var a = Math.abs(e.r || 0 - e.r0 || 0);
return {
cornerRadius: G(n, function(i) {
return Rr(i, a);
})
};
}
var Bv = Math.max, zv = Math.min;
function q5(r, e) {
var t = r.getArea && r.getArea();
if (Ni(r, "cartesian2d")) {
var n = r.getBaseAxis();
if (n.type !== "category" || !n.onBand) {
var a = e.getLayout("bandWidth");
n.isHorizontal() ? (t.x -= a, t.width += a * 2) : (t.y -= a, t.height += a * 2);
}
}
return t;
}
var K5 = (
/** @class */
function(r) {
O(e, r);
function e() {
var t = r.call(this) || this;
return t.type = e.type, t._isFirstFrame = !0, t;
}
return e.prototype.render = function(t, n, a, i) {
this._model = t, this._removeOnRenderedListener(a), this._updateDrawMode(t);
var o = t.get("coordinateSystem");
o === "cartesian2d" || o === "polar" ? (this._progressiveEls = null, this._isLargeDraw ? this._renderLarge(t, n, a) : this._renderNormal(t, n, a, i)) : process.env.NODE_ENV !== "production" && Zt("Only cartesian2d and polar supported for bar.");
}, e.prototype.incrementalPrepareRender = function(t) {
this._clear(), this._updateDrawMode(t), this._updateLargeClip(t);
}, e.prototype.incrementalRender = function(t, n) {
this._progressiveEls = [], this._incrementalRenderLarge(t, n);
}, e.prototype.eachRendered = function(t) {
ma(this._progressiveEls || this.group, t);
}, e.prototype._updateDrawMode = function(t) {
var n = t.pipelineContext.large;
(this._isLargeDraw == null || n !== this._isLargeDraw) && (this._isLargeDraw = n, this._clear());
}, e.prototype._renderNormal = function(t, n, a, i) {
var o = this.group, s = t.getData(), l = this._data, u = t.coordinateSystem, h = u.getBaseAxis(), f;
u.type === "cartesian2d" ? f = h.isHorizontal() : u.type === "polar" && (f = h.dim === "angle");
var c = t.isAnimationEnabled() ? t : null, v = j5(t, u);
v && this._enableRealtimeSort(v, s, a);
var p = t.get("clip", !0) || v, d = q5(u, s);
o.removeClipPath();
var g = t.get("roundCap", !0), y = t.get("showBackground", !0), m = t.getModel("backgroundStyle"), _ = m.get("borderRadius") || 0, S = [], x = this._backgroundEls, b = i && i.isInitSort, w = i && i.type === "changeAxisOrder";
function T(M) {
var I = Bu[u.type](s, M), L = a3(u, f, I);
return L.useStyle(m.getItemStyle()), u.type === "cartesian2d" ? L.setShape("r", _) : L.setShape("cornerRadius", _), S[M] = L, L;
}
s.diff(l).add(function(M) {
var I = s.getItemModel(M), L = Bu[u.type](s, M, I);
if (y && T(M), !(!s.hasValue(M) || !DS[u.type](L))) {
var E = !1;
p && (E = bS[u.type](d, L));
var P = wS[u.type](t, s, M, L, f, c, h.model, !1, g);
v && (P.forceLabelAnimation = !0), AS(P, s, M, I, L, t, f, u.type === "polar"), b ? P.attr({
shape: L
}) : v ? TS(v, c, P, L, M, f, !1, !1) : $t(P, {
shape: L
}, t, M), s.setItemGraphicEl(M, P), o.add(P), P.ignore = E;
}
}).update(function(M, I) {
var L = s.getItemModel(M), E = Bu[u.type](s, M, L);
if (y) {
var P = void 0;
x.length === 0 ? P = T(I) : (P = x[I], P.useStyle(m.getItemStyle()), u.type === "cartesian2d" ? P.setShape("r", _) : P.setShape("cornerRadius", _), S[M] = P);
var k = Bu[u.type](s, M), N = GM(f, k, u);
Ct(P, {
shape: N
}, c, M);
}
var R = l.getItemGraphicEl(I);
if (!s.hasValue(M) || !DS[u.type](E)) {
o.remove(R);
return;
}
var V = !1;
if (p && (V = bS[u.type](d, E), V && o.remove(R)), R ? Or(R) : R = wS[u.type](t, s, M, E, f, c, h.model, !!R, g), v && (R.forceLabelAnimation = !0), w) {
var F = R.getTextContent();
if (F) {
var H = Fo(F);
H.prevValue != null && (H.prevValue = H.value);
}
} else
AS(R, s, M, L, E, t, f, u.type === "polar");
b ? R.attr({
shape: E
}) : v ? TS(v, c, R, E, M, f, !0, w) : Ct(R, {
shape: E
}, t, M, null), s.setItemGraphicEl(M, R), R.ignore = V, o.add(R);
}).remove(function(M) {
var I = l.getItemGraphicEl(M);
I && cl(I, t, M);
}).execute();
var C = this._backgroundGroup || (this._backgroundGroup = new at());
C.removeAll();
for (var D = 0; D < S.length; ++D)
C.add(S[D]);
o.add(C), this._backgroundEls = S, this._data = s;
}, e.prototype._renderLarge = function(t, n, a) {
this._clear(), IS(t, this.group), this._updateLargeClip(t);
}, e.prototype._incrementalRenderLarge = function(t, n) {
this._removeBackground(), IS(n, this.group, this._progressiveEls, !0);
}, e.prototype._updateLargeClip = function(t) {
var n = t.get("clip", !0) && Xl(t.coordinateSystem, !1, t), a = this.group;
n ? a.setClipPath(n) : a.removeClipPath();
}, e.prototype._enableRealtimeSort = function(t, n, a) {
var i = this;
if (n.count()) {
var o = t.baseAxis;
if (this._isFirstFrame)
this._dispatchInitSort(n, t, a), this._isFirstFrame = !1;
else {
var s = function(l) {
var u = n.getItemGraphicEl(l), h = u && u.shape;
return h && // The result should be consistent with the initial sort by data value.
// Do not support the case that both positive and negative exist.
Math.abs(o.isHorizontal() ? h.height : h.width) || 0;
};
this._onRendered = function() {
i._updateSortWithinSameData(n, s, o, a);
}, a.getZr().on("rendered", this._onRendered);
}
}
}, e.prototype._dataSort = function(t, n, a) {
var i = [];
return t.each(t.mapDimension(n.dim), function(o, s) {
var l = a(s);
l = l ?? NaN, i.push({
dataIndex: s,
mappedValue: l,
ordinalNumber: o
});
}), i.sort(function(o, s) {
return s.mappedValue - o.mappedValue;
}), {
ordinalNumbers: G(i, function(o) {
return o.ordinalNumber;
})
};
}, e.prototype._isOrderChangedWithinSameData = function(t, n, a) {
for (var i = a.scale, o = t.mapDimension(a.dim), s = Number.MAX_VALUE, l = 0, u = i.getOrdinalMeta().categories.length; l < u; ++l) {
var h = t.rawIndexOf(o, i.getRawOrdinalNumber(l)), f = h < 0 ? Number.MIN_VALUE : n(t.indexOfRawIndex(h));
if (f > s)
return !0;
s = f;
}
return !1;
}, e.prototype._isOrderDifferentInView = function(t, n) {
for (var a = n.scale, i = a.getExtent(), o = Math.max(0, i[0]), s = Math.min(i[1], a.getOrdinalMeta().categories.length - 1); o <= s; ++o)
if (t.ordinalNumbers[o] !== a.getRawOrdinalNumber(o))
return !0;
}, e.prototype._updateSortWithinSameData = function(t, n, a, i) {
if (this._isOrderChangedWithinSameData(t, n, a)) {
var o = this._dataSort(t, a, n);
this._isOrderDifferentInView(o, a) && (this._removeOnRenderedListener(i), i.dispatchAction({
type: "changeAxisOrder",
componentType: a.dim + "Axis",
axisId: a.index,
sortInfo: o
}));
}
}, e.prototype._dispatchInitSort = function(t, n, a) {
var i = n.baseAxis, o = this._dataSort(t, i, function(s) {
return t.get(t.mapDimension(n.otherAxis.dim), s);
});
a.dispatchAction({
type: "changeAxisOrder",
componentType: i.dim + "Axis",
isInitSort: !0,
axisId: i.index,
sortInfo: o
});
}, e.prototype.remove = function(t, n) {
this._clear(this._model), this._removeOnRenderedListener(n);
}, e.prototype.dispose = function(t, n) {
this._removeOnRenderedListener(n);
}, e.prototype._removeOnRenderedListener = function(t) {
this._onRendered && (t.getZr().off("rendered", this._onRendered), this._onRendered = null);
}, e.prototype._clear = function(t) {
var n = this.group, a = this._data;
t && t.isAnimationEnabled() && a && !this._isLargeDraw ? (this._removeBackground(), this._backgroundEls = [], a.eachItemGraphicEl(function(i) {
cl(i, t, it(i).dataIndex);
})) : n.removeAll(), this._data = null, this._isFirstFrame = !0;
}, e.prototype._removeBackground = function() {
this.group.remove(this._backgroundGroup), this._backgroundGroup = null;
}, e.type = "bar", e;
}(kt)
), bS = {
cartesian2d: function(r, e) {
var t = e.width < 0 ? -1 : 1, n = e.height < 0 ? -1 : 1;
t < 0 && (e.x += e.width, e.width = -e.width), n < 0 && (e.y += e.height, e.height = -e.height);
var a = r.x + r.width, i = r.y + r.height, o = Bv(e.x, r.x), s = zv(e.x + e.width, a), l = Bv(e.y, r.y), u = zv(e.y + e.height, i), h = s < o, f = u < l;
return e.x = h && o > a ? s : o, e.y = f && l > i ? u : l, e.width = h ? 0 : s - o, e.height = f ? 0 : u - l, t < 0 && (e.x += e.width, e.width = -e.width), n < 0 && (e.y += e.height, e.height = -e.height), h || f;
},
polar: function(r, e) {
var t = e.r0 <= e.r ? 1 : -1;
if (t < 0) {
var n = e.r;
e.r = e.r0, e.r0 = n;
}
var a = zv(e.r, r.r), i = Bv(e.r0, r.r0);
e.r = a, e.r0 = i;
var o = a - i < 0;
if (t < 0) {
var n = e.r;
e.r = e.r0, e.r0 = n;
}
return o;
}
}, wS = {
cartesian2d: function(r, e, t, n, a, i, o, s, l) {
var u = new xt({
shape: B({}, n),
z2: 1
});
if (u.__dataIndex = t, u.name = "item", i) {
var h = u.shape, f = a ? "height" : "width";
h[f] = 0;
}
return u;
},
polar: function(r, e, t, n, a, i, o, s, l) {
var u = !a && l ? of : Ge, h = new u({
shape: n,
z2: 1
});
h.name = "item";
var f = zM(a);
if (h.calculateTextPosition = Z5(f, {
isRoundCap: u === of
}), i) {
var c = h.shape, v = a ? "r" : "endAngle", p = {};
c[v] = a ? n.r0 : n.startAngle, p[v] = n[v], (s ? Ct : $t)(h, {
shape: p
// __value: typeof dataValue === 'string' ? parseInt(dataValue, 10) : dataValue
}, i);
}
return h;
}
};
function j5(r, e) {
var t = r.get("realtimeSort", !0), n = e.getBaseAxis();
if (process.env.NODE_ENV !== "production" && t && (n.type !== "category" && Zt("`realtimeSort` will not work because this bar series is not based on a category axis."), e.type !== "cartesian2d" && Zt("`realtimeSort` will not work because this bar series is not on cartesian2d.")), t && n.type === "category" && e.type === "cartesian2d")
return {
baseAxis: n,
otherAxis: e.getOtherAxis(n)
};
}
function TS(r, e, t, n, a, i, o, s) {
var l, u;
i ? (u = {
x: n.x,
width: n.width
}, l = {
y: n.y,
height: n.height
}) : (u = {
y: n.y,
height: n.height
}, l = {
x: n.x,
width: n.width
}), s || (o ? Ct : $t)(t, {
shape: l
}, e, a, null);
var h = e ? r.baseAxis.model : null;
(o ? Ct : $t)(t, {
shape: u
}, h, a);
}
function CS(r, e) {
for (var t = 0; t < e.length; t++)
if (!isFinite(r[e[t]]))
return !0;
return !1;
}
var Q5 = ["x", "y", "width", "height"], J5 = ["cx", "cy", "r", "startAngle", "endAngle"], DS = {
cartesian2d: function(r) {
return !CS(r, Q5);
},
polar: function(r) {
return !CS(r, J5);
}
}, Bu = {
// itemModel is only used to get borderWidth, which is not needed
// when calculating bar background layout.
cartesian2d: function(r, e, t) {
var n = r.getItemLayout(e), a = t ? e3(t, n) : 0, i = n.width > 0 ? 1 : -1, o = n.height > 0 ? 1 : -1;
return {
x: n.x + i * a / 2,
y: n.y + o * a / 2,
width: n.width - i * a,
height: n.height - o * a
};
},
polar: function(r, e, t) {
var n = r.getItemLayout(e);
return {
cx: n.cx,
cy: n.cy,
r0: n.r0,
r: n.r,
startAngle: n.startAngle,
endAngle: n.endAngle,
clockwise: n.clockwise
};
}
};
function t3(r) {
return r.startAngle != null && r.endAngle != null && r.startAngle === r.endAngle;
}
function zM(r) {
return /* @__PURE__ */ function(e) {
var t = e ? "Arc" : "Angle";
return function(n) {
switch (n) {
case "start":
case "insideStart":
case "end":
case "insideEnd":
return n + t;
default:
return n;
}
};
}(r);
}
function AS(r, e, t, n, a, i, o, s) {
var l = e.getItemVisual(t, "style");
if (s) {
if (!i.get("roundCap")) {
var h = r.shape, f = li(n.getModel("itemStyle"), h, !0);
B(h, f), r.setShape(h);
}
} else {
var u = n.get(["itemStyle", "borderRadius"]) || 0;
r.setShape("r", u);
}
r.useStyle(l);
var c = n.getShallow("cursor");
c && r.attr("cursor", c);
var v = s ? o ? a.r >= a.r0 ? "endArc" : "startArc" : a.endAngle >= a.startAngle ? "endAngle" : "startAngle" : o ? a.height >= 0 ? "bottom" : "top" : a.width >= 0 ? "right" : "left", p = ve(n);
xe(r, p, {
labelFetcher: i,
labelDataIndex: t,
defaultText: Lo(i.getData(), t),
inheritColor: l.fill,
defaultOpacity: l.opacity,
defaultOutsidePosition: v
});
var d = r.getTextContent();
if (s && d) {
var g = n.get(["label", "position"]);
r.textConfig.inside = g === "middle" ? !0 : null, X5(r, g === "outside" ? v : g, zM(o), n.get(["label", "rotate"]));
}
oD(d, p, i.getRawValue(t), function(m) {
return LM(e, m);
});
var y = n.getModel(["emphasis"]);
Xt(r, y.get("focus"), y.get("blurScope"), y.get("disabled")), Se(r, n), t3(a) && (r.style.fill = "none", r.style.stroke = "none", A(r.states, function(m) {
m.style && (m.style.fill = m.style.stroke = "none");
}));
}
function e3(r, e) {
var t = r.get(["itemStyle", "borderColor"]);
if (!t || t === "none")
return 0;
var n = r.get(["itemStyle", "borderWidth"]) || 0, a = isNaN(e.width) ? Number.MAX_VALUE : Math.abs(e.width), i = isNaN(e.height) ? Number.MAX_VALUE : Math.abs(e.height);
return Math.min(n, a, i);
}
var r3 = (
/** @class */
/* @__PURE__ */ function() {
function r() {
}
return r;
}()
), MS = (
/** @class */
function(r) {
O(e, r);
function e(t) {
var n = r.call(this, t) || this;
return n.type = "largeBar", n;
}
return e.prototype.getDefaultShape = function() {
return new r3();
}, e.prototype.buildPath = function(t, n) {
for (var a = n.points, i = this.baseDimIdx, o = 1 - this.baseDimIdx, s = [], l = [], u = this.barWidth, h = 0; h < a.length; h += 3)
l[i] = u, l[o] = a[h + 2], s[i] = a[h + i], s[o] = a[h + o], t.rect(s[0], s[1], l[0], l[1]);
}, e;
}(mt)
);
function IS(r, e, t, n) {
var a = r.getData(), i = a.getLayout("valueAxisHorizontal") ? 1 : 0, o = a.getLayout("largeDataIndices"), s = a.getLayout("size"), l = r.getModel("backgroundStyle"), u = a.getLayout("largeBackgroundPoints");
if (u) {
var h = new MS({
shape: {
points: u
},
incremental: !!n,
silent: !0,
z2: 0
});
h.baseDimIdx = i, h.largeDataIndices = o, h.barWidth = s, h.useStyle(l.getItemStyle()), e.add(h), t && t.push(h);
}
var f = new MS({
shape: {
points: a.getLayout("largePoints")
},
incremental: !!n,
ignoreCoarsePointer: !0,
z2: 1
});
f.baseDimIdx = i, f.largeDataIndices = o, f.barWidth = s, e.add(f), f.useStyle(a.getVisual("style")), f.style.stroke = null, it(f).seriesIndex = r.seriesIndex, r.get("silent") || (f.on("mousedown", LS), f.on("mousemove", LS)), t && t.push(f);
}
var LS = Vy(function(r) {
var e = this, t = n3(e, r.offsetX, r.offsetY);
it(e).dataIndex = t >= 0 ? t : null;
}, 30, !1);
function n3(r, e, t) {
for (var n = r.baseDimIdx, a = 1 - n, i = r.shape.points, o = r.largeDataIndices, s = [], l = [], u = r.barWidth, h = 0, f = i.length / 3; h < f; h++) {
var c = h * 3;
if (l[n] = u, l[a] = i[c + 2], s[n] = i[c + n], s[a] = i[c + a], l[a] < 0 && (s[a] += l[a], l[a] = -l[a]), e >= s[0] && e <= s[0] + l[0] && t >= s[1] && t <= s[1] + l[1])
return o[h];
}
return -1;
}
function GM(r, e, t) {
if (Ni(t, "cartesian2d")) {
var n = e, a = t.getArea();
return {
x: r ? n.x : a.x,
y: r ? a.y : n.y,
width: r ? n.width : a.width,
height: r ? a.height : n.height
};
} else {
var a = t.getArea(), i = e;
return {
cx: a.cx,
cy: a.cy,
r0: r ? a.r0 : i.r0,
r: r ? a.r : i.r,
startAngle: r ? i.startAngle : 0,
endAngle: r ? i.endAngle : Math.PI * 2
};
}
}
function a3(r, e, t) {
var n = r.type === "polar" ? Ge : xt;
return new n({
shape: GM(e, t, r),
silent: !0,
z2: 0
});
}
function i3(r) {
r.registerChartView(K5), r.registerSeriesModel(U5), r.registerLayout(r.PRIORITY.VISUAL.LAYOUT, ut(UA, "bar")), r.registerLayout(r.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT, YA("bar")), r.registerProcessor(r.PRIORITY.PROCESSOR.STATISTIC, BM("bar")), r.registerAction({
type: "changeAxisOrder",
event: "changeAxisOrder",
update: "update"
}, function(e, t) {
var n = e.componentType || "series";
t.eachComponent({
mainType: n,
query: e
}, function(a) {
e.sortInfo && a.axis.setCategorySortInfo(e.sortInfo);
});
});
}
var ES = Math.PI * 2, zu = Math.PI / 180;
function FM(r, e) {
return se(r.getBoxLayoutParams(), {
width: e.getWidth(),
height: e.getHeight()
});
}
function HM(r, e) {
var t = FM(r, e), n = r.get("center"), a = r.get("radius");
z(a) || (a = [0, a]);
var i = W(t.width, e.getWidth()), o = W(t.height, e.getHeight()), s = Math.min(i, o), l = W(a[0], s / 2), u = W(a[1], s / 2), h, f, c = r.coordinateSystem;
if (c) {
var v = c.dataToPoint(n);
h = v[0] || 0, f = v[1] || 0;
} else
z(n) || (n = [n, n]), h = W(n[0], i) + t.x, f = W(n[1], o) + t.y;
return {
cx: h,
cy: f,
r0: l,
r: u
};
}
function o3(r, e, t) {
e.eachSeriesByType(r, function(n) {
var a = n.getData(), i = a.mapDimension("value"), o = FM(n, t), s = HM(n, t), l = s.cx, u = s.cy, h = s.r, f = s.r0, c = -n.get("startAngle") * zu, v = n.get("endAngle"), p = n.get("padAngle") * zu;
v = v === "auto" ? c - ES : -v * zu;
var d = n.get("minAngle") * zu, g = d + p, y = 0;
a.each(i, function(N) {
!isNaN(N) && y++;
});
var m = a.getSum(i), _ = Math.PI / (m || y) * 2, S = n.get("clockwise"), x = n.get("roseType"), b = n.get("stillShowZeroSum"), w = a.getDataExtent(i);
w[0] = 0;
var T = S ? 1 : -1, C = [c, v], D = T * p / 2;
cy(C, !S), c = C[0], v = C[1];
var M = WM(n);
M.startAngle = c, M.endAngle = v, M.clockwise = S;
var I = Math.abs(v - c), L = I, E = 0, P = c;
if (a.setLayout({
viewRect: o,
r: h
}), a.each(i, function(N, R) {
var V;
if (isNaN(N)) {
a.setItemLayout(R, {
angle: NaN,
startAngle: NaN,
endAngle: NaN,
clockwise: S,
cx: l,
cy: u,
r0: f,
r: x ? NaN : h
});
return;
}
x !== "area" ? V = m === 0 && b ? _ : N * _ : V = I / y, V < g ? (V = g, L -= g) : E += N;
var F = P + T * V, H = 0, $ = 0;
p > V ? (H = P + T * V / 2, $ = H) : (H = P + D, $ = F - D), a.setItemLayout(R, {
angle: V,
startAngle: H,
endAngle: $,
clockwise: S,
cx: l,
cy: u,
r0: f,
r: x ? Mt(N, w, [f, h]) : h
}), P = F;
}), L < ES && y)
if (L <= 1e-3) {
var k = I / y;
a.each(i, function(N, R) {
if (!isNaN(N)) {
var V = a.getItemLayout(R);
V.angle = k;
var F = 0, H = 0;
k < p ? (F = c + T * (R + 1 / 2) * k, H = F) : (F = c + T * R * k + D, H = c + T * (R + 1) * k - D), V.startAngle = F, V.endAngle = H;
}
});
} else
_ = L / E, P = c, a.each(i, function(N, R) {
if (!isNaN(N)) {
var V = a.getItemLayout(R), F = V.angle === g ? g : N * _, H = 0, $ = 0;
F < p ? (H = P + T * F / 2, $ = H) : (H = P + D, $ = P + T * F - D), V.startAngle = H, V.endAngle = $, P += T * F;
}
});
});
}
var WM = bt();
function Kl(r) {
return {
seriesType: r,
reset: function(e, t) {
var n = t.findComponents({
mainType: "legend"
});
if (!(!n || !n.length)) {
var a = e.getData();
a.filterSelf(function(i) {
for (var o = a.getName(i), s = 0; s < n.length; s++)
if (!n[s].isSelected(o))
return !1;
return !0;
});
}
}
};
}
var s3 = Math.PI / 180;
function PS(r, e, t, n, a, i, o, s, l, u) {
if (r.length < 2)
return;
function h(d) {
for (var g = d.rB, y = g * g, m = 0; m < d.list.length; m++) {
var _ = d.list[m], S = Math.abs(_.label.y - t), x = n + _.len, b = x * x, w = Math.sqrt(Math.abs((1 - S * S / y) * b)), T = e + (w + _.len2) * a, C = T - _.label.x, D = _.targetTextWidth - C * a;
$M(_, D, !0), _.label.x = T;
}
}
function f(d) {
for (var g = {
list: [],
maxY: 0
}, y = {
list: [],
maxY: 0
}, m = 0; m < d.length; m++)
if (d[m].labelAlignTo === "none") {
var _ = d[m], S = _.label.y > t ? y : g, x = Math.abs(_.label.y - t);
if (x >= S.maxY) {
var b = _.label.x - e - _.len2 * a, w = n + _.len, T = Math.abs(b) < w ? Math.sqrt(x * x / (1 - b * b / w / w)) : w;
S.rB = T, S.maxY = x;
}
S.list.push(_);
}
h(g), h(y);
}
for (var c = r.length, v = 0; v < c; v++)
if (r[v].position === "outer" && r[v].labelAlignTo === "labelLine") {
var p = r[v].label.x - u;
r[v].linePoints[1][0] += p, r[v].label.x = u;
}
vM(r, l, l + o) && f(r);
}
function l3(r, e, t, n, a, i, o, s) {
for (var l = [], u = [], h = Number.MAX_VALUE, f = -Number.MAX_VALUE, c = 0; c < r.length; c++) {
var v = r[c].label;
Gv(r[c]) || (v.x < e ? (h = Math.min(h, v.x), l.push(r[c])) : (f = Math.max(f, v.x), u.push(r[c])));
}
for (var c = 0; c < r.length; c++) {
var p = r[c];
if (!Gv(p) && p.linePoints) {
if (p.labelStyleWidth != null)
continue;
var v = p.label, d = p.linePoints, g = void 0;
p.labelAlignTo === "edge" ? v.x < e ? g = d[2][0] - p.labelDistance - o - p.edgeDistance : g = o + a - p.edgeDistance - d[2][0] - p.labelDistance : p.labelAlignTo === "labelLine" ? v.x < e ? g = h - o - p.bleedMargin : g = o + a - f - p.bleedMargin : v.x < e ? g = v.x - o - p.bleedMargin : g = o + a - v.x - p.bleedMargin, p.targetTextWidth = g, $M(p, g);
}
}
PS(u, e, t, n, 1, a, i, o, s, f), PS(l, e, t, n, -1, a, i, o, s, h);
for (var c = 0; c < r.length; c++) {
var p = r[c];
if (!Gv(p) && p.linePoints) {
var v = p.label, d = p.linePoints, y = p.labelAlignTo === "edge", m = v.style.padding, _ = m ? m[1] + m[3] : 0, S = v.style.backgroundColor ? 0 : _, x = p.rect.width + S, b = d[1][0] - d[2][0];
y ? v.x < e ? d[2][0] = o + p.edgeDistance + x + p.labelDistance : d[2][0] = o + a - p.edgeDistance - x - p.labelDistance : (v.x < e ? d[2][0] = v.x + p.labelDistance : d[2][0] = v.x - p.labelDistance, d[1][0] = d[2][0] + b), d[1][1] = d[2][1] = v.y;
}
}
}
function $M(r, e, t) {
if (t === void 0 && (t = !1), r.labelStyleWidth == null) {
var n = r.label, a = n.style, i = r.rect, o = a.backgroundColor, s = a.padding, l = s ? s[1] + s[3] : 0, u = a.overflow, h = i.width + (o ? 0 : l);
if (e < h || t) {
var f = i.height;
if (u && u.match("break")) {
n.setStyle("backgroundColor", null), n.setStyle("width", e - l);
var c = n.getBoundingRect();
n.setStyle("width", Math.ceil(c.width)), n.setStyle("backgroundColor", o);
} else {
var v = e - l, p = e < h ? v : (
// Current available width is enough, but the text may have
// already been wrapped with a smaller available width.
t ? v > r.unconstrainedWidth ? null : v : null
);
n.setStyle("width", p);
}
var d = n.getBoundingRect();
i.width = d.width;
var g = (n.style.margin || 0) + 2.1;
i.height = d.height + g, i.y -= (i.height - f) / 2;
}
}
}
function Gv(r) {
return r.position === "center";
}
function u3(r) {
var e = r.getData(), t = [], n, a, i = !1, o = (r.get("minShowLabelAngle") || 0) * s3, s = e.getLayout("viewRect"), l = e.getLayout("r"), u = s.width, h = s.x, f = s.y, c = s.height;
function v(b) {
b.ignore = !0;
}
function p(b) {
if (!b.ignore)
return !0;
for (var w in b.states)
if (b.states[w].ignore === !1)
return !0;
return !1;
}
e.each(function(b) {
var w = e.getItemGraphicEl(b), T = w.shape, C = w.getTextContent(), D = w.getTextGuideLine(), M = e.getItemModel(b), I = M.getModel("label"), L = I.get("position") || M.get(["emphasis", "label", "position"]), E = I.get("distanceToLabelLine"), P = I.get("alignTo"), k = W(I.get("edgeDistance"), u), N = I.get("bleedMargin"), R = M.getModel("labelLine"), V = R.get("length");
V = W(V, u);
var F = R.get("length2");
if (F = W(F, u), Math.abs(T.endAngle - T.startAngle) < o) {
A(C.states, v), C.ignore = !0, D && (A(D.states, v), D.ignore = !0);
return;
}
if (p(C)) {
var H = (T.startAngle + T.endAngle) / 2, $ = Math.cos(H), j = Math.sin(H), Q, st, Et, qt;
n = T.cx, a = T.cy;
var vt = L === "inside" || L === "inner";
if (L === "center")
Q = T.cx, st = T.cy, qt = "center";
else {
var rt = (vt ? (T.r + T.r0) / 2 * $ : T.r * $) + n, dt = (vt ? (T.r + T.r0) / 2 * j : T.r * j) + a;
if (Q = rt + $ * 3, st = dt + j * 3, !vt) {
var q = rt + $ * (V + l - T.r), lt = dt + j * (V + l - T.r), Vt = q + ($ < 0 ? -1 : 1) * F, Lt = lt;
P === "edge" ? Q = $ < 0 ? h + k : h + u - k : Q = Vt + ($ < 0 ? -E : E), st = Lt, Et = [[rt, dt], [q, lt], [Vt, Lt]];
}
qt = vt ? "center" : P === "edge" ? $ > 0 ? "right" : "left" : $ > 0 ? "left" : "right";
}
var Rt = Math.PI, Ut = 0, le = I.get("rotate");
if (Tt(le))
Ut = le * (Rt / 180);
else if (L === "center")
Ut = 0;
else if (le === "radial" || le === !0) {
var Ke = $ < 0 ? -H + Rt : -H;
Ut = Ke;
} else if (le === "tangential" && L !== "outside" && L !== "outer") {
var We = Math.atan2($, j);
We < 0 && (We = Rt * 2 + We);
var Sa = j > 0;
Sa && (We = Rt + We), Ut = We - Rt;
}
if (i = !!Ut, C.x = Q, C.y = st, C.rotation = Ut, C.setStyle({
verticalAlign: "middle"
}), vt) {
C.setStyle({
align: qt
});
var _c = C.states.select;
_c && (_c.x += C.x, _c.y += C.y);
} else {
var Vn = C.getBoundingRect().clone();
Vn.applyTransform(C.getComputedTransform());
var r0 = (C.style.margin || 0) + 2.1;
Vn.y -= r0 / 2, Vn.height += r0, t.push({
label: C,
labelLine: D,
position: L,
len: V,
len2: F,
minTurnAngle: R.get("minTurnAngle"),
maxSurfaceAngle: R.get("maxSurfaceAngle"),
surfaceNormal: new ft($, j),
linePoints: Et,
textAlign: qt,
labelDistance: E,
labelAlignTo: P,
edgeDistance: k,
bleedMargin: N,
rect: Vn,
unconstrainedWidth: Vn.width,
labelStyleWidth: C.style.width
});
}
w.setTextConfig({
inside: vt
});
}
}), !i && r.get("avoidLabelOverlap") && l3(t, n, a, l, u, c, h, f);
for (var d = 0; d < t.length; d++) {
var g = t[d], y = g.label, m = g.labelLine, _ = isNaN(y.x) || isNaN(y.y);
if (y) {
y.setStyle({
align: g.textAlign
}), _ && (A(y.states, v), y.ignore = !0);
var S = y.states.select;
S && (S.x += y.x, S.y += y.y);
}
if (m) {
var x = g.linePoints;
_ || !x ? (A(m.states, v), m.ignore = !0) : (hM(x, g.minTurnAngle), Pz(x, g.surfaceNormal, g.maxSurfaceAngle), m.setShape({
points: x
}), y.__hostTarget.textGuideLineConfig = {
anchor: new ft(x[0][0], x[0][1])
});
}
}
}
var h3 = (
/** @class */
function(r) {
O(e, r);
function e(t, n, a) {
var i = r.call(this) || this;
i.z2 = 2;
var o = new wt();
return i.setTextContent(o), i.updateData(t, n, a, !0), i;
}
return e.prototype.updateData = function(t, n, a, i) {
var o = this, s = t.hostModel, l = t.getItemModel(n), u = l.getModel("emphasis"), h = t.getItemLayout(n), f = B(li(l.getModel("itemStyle"), h, !0), h);
if (isNaN(f.startAngle)) {
o.setShape(f);
return;
}
if (i) {
o.setShape(f);
var c = s.getShallow("animationType");
s.ecModel.ssr ? ($t(o, {
scaleX: 0,
scaleY: 0
}, s, {
dataIndex: n,
isFrom: !0
}), o.originX = f.cx, o.originY = f.cy) : c === "scale" ? (o.shape.r = h.r0, $t(o, {
shape: {
r: h.r
}
}, s, n)) : a != null ? (o.setShape({
startAngle: a,
endAngle: a
}), $t(o, {
shape: {
startAngle: h.startAngle,
endAngle: h.endAngle
}
}, s, n)) : (o.shape.endAngle = h.startAngle, Ct(o, {
shape: {
endAngle: h.endAngle
}
}, s, n));
} else
Or(o), Ct(o, {
shape: f
}, s, n);
o.useStyle(t.getItemVisual(n, "style")), Se(o, l);
var v = (h.startAngle + h.endAngle) / 2, p = s.get("selectedOffset"), d = Math.cos(v) * p, g = Math.sin(v) * p, y = l.getShallow("cursor");
y && o.attr("cursor", y), this._updateLabel(s, t, n), o.ensureState("emphasis").shape = B({
r: h.r + (u.get("scale") && u.get("scaleSize") || 0)
}, li(u.getModel("itemStyle"), h)), B(o.ensureState("select"), {
x: d,
y: g,
shape: li(l.getModel(["select", "itemStyle"]), h)
}), B(o.ensureState("blur"), {
shape: li(l.getModel(["blur", "itemStyle"]), h)
});
var m = o.getTextGuideLine(), _ = o.getTextContent();
m && B(m.ensureState("select"), {
x: d,
y: g
}), B(_.ensureState("select"), {
x: d,
y: g
}), Xt(this, u.get("focus"), u.get("blurScope"), u.get("disabled"));
}, e.prototype._updateLabel = function(t, n, a) {
var i = this, o = n.getItemModel(a), s = o.getModel("labelLine"), l = n.getItemVisual(a, "style"), u = l && l.fill, h = l && l.opacity;
xe(i, ve(o), {
labelFetcher: n.hostModel,
labelDataIndex: a,
inheritColor: u,
defaultOpacity: h,
defaultText: t.getFormattedLabel(a, "normal") || n.getName(a)
});
var f = i.getTextContent();
i.setTextConfig({
// reset position, rotation
position: null,
rotation: null
}), f.attr({
z2: 10
});
var c = t.get(["label", "position"]);
if (c !== "outside" && c !== "outer")
i.removeTextGuideLine();
else {
var v = this.getTextGuideLine();
v || (v = new He(), this.setTextGuideLine(v)), Ky(this, jy(o), {
stroke: u,
opacity: mr(s.get(["lineStyle", "opacity"]), h, 1)
});
}
}, e;
}(Ge)
), f3 = (
/** @class */
function(r) {
O(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t.ignoreLabelLineUpdate = !0, t;
}
return e.prototype.render = function(t, n, a, i) {
var o = t.getData(), s = this._data, l = this.group, u;
if (!s && o.count() > 0) {
for (var h = o.getItemLayout(0), f = 1; isNaN(h && h.startAngle) && f < o.count(); ++f)
h = o.getItemLayout(f);
h && (u = h.startAngle);
}
if (this._emptyCircleSector && l.remove(this._emptyCircleSector), o.count() === 0 && t.get("showEmptyCircle")) {
var c = WM(t), v = new Ge({
shape: B(HM(t, a), c)
});
v.useStyle(t.getModel("emptyCircleStyle").getItemStyle()), this._emptyCircleSector = v, l.add(v);
}
o.diff(s).add(function(p) {
var d = new h3(o, p, u);
o.setItemGraphicEl(p, d), l.add(d);
}).update(function(p, d) {
var g = s.getItemGraphicEl(d);
g.updateData(o, p, u), g.off("click"), l.add(g), o.setItemGraphicEl(p, g);
}).remove(function(p) {
var d = s.getItemGraphicEl(p);
cl(d, t, p);
}).execute(), u3(t), t.get("animationTypeUpdate") !== "expansion" && (this._data = o);
}, e.prototype.dispose = function() {
}, e.prototype.containPoint = function(t, n) {
var a = n.getData(), i = a.getItemLayout(0);
if (i) {
var o = t[0] - i.cx, s = t[1] - i.cy, l = Math.sqrt(o * o + s * s);
return l <= i.r && l >= i.r0;
}
}, e.type = "pie", e;
}(kt)
);
function jo(r, e, t) {
e = z(e) && {
coordDimensions: e
} || B({
encodeDefine: r.getEncode()
}, e);
var n = r.getSource(), a = $l(n, e).dimensions, i = new Ne(a, r);
return i.initData(n, t), i;
}
var jl = (
/** @class */
function() {
function r(e, t) {
this._getDataWithEncodedVisual = e, this._getRawData = t;
}
return r.prototype.getAllNames = function() {
var e = this._getRawData();
return e.mapArray(e.getName);
}, r.prototype.containName = function(e) {
var t = this._getRawData();
return t.indexOfName(e) >= 0;
}, r.prototype.indexOfName = function(e) {
var t = this._getDataWithEncodedVisual();
return t.indexOfName(e);
}, r.prototype.getItemVisual = function(e, t) {
var n = this._getDataWithEncodedVisual();
return n.getItemVisual(e, t);
}, r;
}()
), c3 = bt(), v3 = (
/** @class */
function(r) {
O(e, r);
function e() {
return r !== null && r.apply(this, arguments) || this;
}
return e.prototype.init = function(t) {
r.prototype.init.apply(this, arguments), this.legendVisualProvider = new jl(Y(this.getData, this), Y(this.getRawData, this)), this._defaultLabelLine(t);
}, e.prototype.mergeOption = function() {
r.prototype.mergeOption.apply(this, arguments);
}, e.prototype.getInitialData = function() {
return jo(this, {
coordDimensions: ["value"],
encodeDefaulter: ut(Iy, this)
});
}, e.prototype.getDataParams = function(t) {
var n = this.getData(), a = c3(n), i = a.seats;
if (!i) {
var o = [];
n.each(n.mapDimension("value"), function(l) {
o.push(l);
}), i = a.seats = jP(o, n.hostModel.get("percentPrecision"));
}
var s = r.prototype.getDataParams.call(this, t);
return s.percent = i[t] || 0, s.$vars.push("percent"), s;
}, e.prototype._defaultLabelLine = function(t) {
xi(t, "labelLine", ["show"]);
var n = t.labelLine, a = t.emphasis.labelLine;
n.show = n.show && t.label.show, a.show = a.show && t.emphasis.label.show;
}, e.type = "series.pie", e.defaultOption = {
// zlevel: 0,
z: 2,
legendHoverLink: !0,
colorBy: "data",
// 默认全局居中
center: ["50%", "50%"],
radius: [0, "75%"],
// 默认顺时针
clockwise: !0,
startAngle: 90,
endAngle: "auto",
padAngle: 0,
// 最小角度改为0
minAngle: 0,
// If the angle of a sector less than `minShowLabelAngle`,
// the label will not be displayed.
minShowLabelAngle: 0,
// 选中时扇区偏移量
selectedOffset: 10,
// 选择模式,默认关闭,可选single,multiple
// selectedMode: false,
// 南丁格尔玫瑰图模式,'radius'(半径) | 'area'(面积)
// roseType: null,
percentPrecision: 2,
// If still show when all data zero.
stillShowZeroSum: !0,
// cursor: null,
left: 0,
top: 0,
right: 0,
bottom: 0,
width: null,
height: null,
label: {
// color: 'inherit',
// If rotate around circle
rotate: 0,
show: !0,
overflow: "truncate",
// 'outer', 'inside', 'center'
position: "outer",
// 'none', 'labelLine', 'edge'. Works only when position is 'outer'
alignTo: "none",
// Closest distance between label and chart edge.
// Works only position is 'outer' and alignTo is 'edge'.
edgeDistance: "25%",
// Works only position is 'outer' and alignTo is not 'edge'.
bleedMargin: 10,
// Distance between text and label line.
distanceToLabelLine: 5
// formatter: 标签文本格式器,同 tooltip.formatter,不支持异步回调
// 默认使用全局文本样式,详见 textStyle
// distance: 当position为inner时有效,为label位置到圆心的距离与圆半径(环状图为内外半径和)的比例系数
},
// Enabled when label.normal.position is 'outer'
labelLine: {
show: !0,
// 引导线两段中的第一段长度
length: 15,
// 引导线两段中的第二段长度
length2: 15,
smooth: !1,
minTurnAngle: 90,
maxSurfaceAngle: 90,
lineStyle: {
// color: 各异,
width: 1,
type: "solid"
}
},
itemStyle: {
borderWidth: 1,
borderJoin: "round"
},
showEmptyCircle: !0,
emptyCircleStyle: {
color: "lightgray",
opacity: 1
},
labelLayout: {
// Hide the overlapped label.
hideOverlap: !0
},
emphasis: {
scale: !0,
scaleSize: 5
},
// If use strategy to avoid label overlapping
avoidLabelOverlap: !0,
// Animation type. Valid values: expansion, scale
animationType: "expansion",
animationDuration: 1e3,
// Animation type when update. Valid values: transition, expansion
animationTypeUpdate: "transition",
animationEasingUpdate: "cubicInOut",
animationDurationUpdate: 500,
animationEasing: "cubicInOut"
}, e;
}(Ft)
);
function p3(r) {
return {
seriesType: r,
reset: function(e, t) {
var n = e.getData();
n.filterSelf(function(a) {
var i = n.mapDimension("value"), o = n.get(i, a);
return !(Tt(o) && !isNaN(o) && o < 0);
});
}
};
}
function d3(r) {
r.registerChartView(f3), r.registerSeriesModel(v3), fA("pie", r.registerAction), r.registerLayout(ut(o3, "pie")), r.registerProcessor(Kl("pie")), r.registerProcessor(p3("pie"));
}
var g3 = (
/** @class */
function(r) {
O(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t.type = e.type, t.hasSymbolVisual = !0, t;
}
return e.prototype.getInitialData = function(t, n) {
return On(null, this, {
useEncodeDefaulter: !0
});
}, e.prototype.getProgressive = function() {
var t = this.option.progressive;
return t ?? (this.option.large ? 5e3 : this.get("progressive"));
}, e.prototype.getProgressiveThreshold = function() {
var t = this.option.progressiveThreshold;
return t ?? (this.option.large ? 1e4 : this.get("progressiveThreshold"));
}, e.prototype.brushSelector = function(t, n, a) {
return a.point(n.getItemLayout(t));
}, e.prototype.getZLevelKey = function() {
return this.getData().count() > this.getProgressiveThreshold() ? this.id : "";
}, e.type = "series.scatter", e.dependencies = ["grid", "polar", "geo", "singleAxis", "calendar"], e.defaultOption = {
coordinateSystem: "cartesian2d",
// zlevel: 0,
z: 2,
legendHoverLink: !0,
symbolSize: 10,
// symbolRotate: null, // 图形旋转控制
large: !1,
// Available when large is true
largeThreshold: 2e3,
// cursor: null,
itemStyle: {
opacity: 0.8
// color: 各异
},
emphasis: {
scale: !0
},
// If clip the overflow graphics
// Works on cartesian / polar series
clip: !0,
select: {
itemStyle: {
borderColor: "#212121"
}
},
universalTransition: {
divideShape: "clone"
}
// progressive: null
}, e;
}(Ft)
), UM = 4, y3 = (
/** @class */
/* @__PURE__ */ function() {
function r() {
}
return r;
}()
), m3 = (
/** @class */
function(r) {
O(e, r);
function e(t) {
var n = r.call(this, t) || this;
return n._off = 0, n.hoverDataIdx = -1, n;
}
return e.prototype.getDefaultShape = function() {
return new y3();
}, e.prototype.reset = function() {
this.notClear = !1, this._off = 0;
}, e.prototype.buildPath = function(t, n) {
var a = n.points, i = n.size, o = this.symbolProxy, s = o.shape, l = t.getContext ? t.getContext() : t, u = l && i[0] < UM, h = this.softClipShape, f;
if (u) {
this._ctx = l;
return;
}
for (this._ctx = null, f = this._off; f < a.length; ) {
var c = a[f++], v = a[f++];
isNaN(c) || isNaN(v) || h && !h.contain(c, v) || (s.x = c - i[0] / 2, s.y = v - i[1] / 2, s.width = i[0], s.height = i[1], o.buildPath(t, s, !0));
}
this.incremental && (this._off = f, this.notClear = !0);
}, e.prototype.afterBrush = function() {
var t = this.shape, n = t.points, a = t.size, i = this._ctx, o = this.softClipShape, s;
if (i) {
for (s = this._off; s < n.length; ) {
var l = n[s++], u = n[s++];
isNaN(l) || isNaN(u) || o && !o.contain(l, u) || i.fillRect(l - a[0] / 2, u - a[1] / 2, a[0], a[1]);
}
this.incremental && (this._off = s, this.notClear = !0);
}
}, e.prototype.findDataIndex = function(t, n) {
for (var a = this.shape, i = a.points, o = a.size, s = Math.max(o[0], 4), l = Math.max(o[1], 4), u = i.length / 2 - 1; u >= 0; u--) {
var h = u * 2, f = i[h] - s / 2, c = i[h + 1] - l / 2;
if (t >= f && n >= c && t <= f + s && n <= c + l)
return u;
}
return -1;
}, e.prototype.contain = function(t, n) {
var a = this.transformCoordToLocal(t, n), i = this.getBoundingRect();
if (t = a[0], n = a[1], i.contain(t, n)) {
var o = this.hoverDataIdx = this.findDataIndex(t, n);
return o >= 0;
}
return this.hoverDataIdx = -1, !1;
}, e.prototype.getBoundingRect = function() {
var t = this._rect;
if (!t) {
for (var n = this.shape, a = n.points, i = n.size, o = i[0], s = i[1], l = 1 / 0, u = 1 / 0, h = -1 / 0, f = -1 / 0, c = 0; c < a.length; ) {
var v = a[c++], p = a[c++];
l = Math.min(v, l), h = Math.max(v, h), u = Math.min(p, u), f = Math.max(p, f);
}
t = this._rect = new ct(l - o / 2, u - s / 2, h - l + o, f - u + s);
}
return t;
}, e;
}(mt)
), _3 = (
/** @class */
function() {
function r() {
this.group = new at();
}
return r.prototype.updateData = function(e, t) {
this._clear();
var n = this._create();
n.setShape({
points: e.getLayout("points")
}), this._setCommon(n, e, t);
}, r.prototype.updateLayout = function(e) {
var t = e.getLayout("points");
this.group.eachChild(function(n) {
if (n.startIndex != null) {
var a = (n.endIndex - n.startIndex) * 2, i = n.startIndex * 4 * 2;
t = new Float32Array(t.buffer, i, a);
}
n.setShape("points", t), n.reset();
});
}, r.prototype.incrementalPrepareUpdate = function(e) {
this._clear();
}, r.prototype.incrementalUpdate = function(e, t, n) {
var a = this._newAdded[0], i = t.getLayout("points"), o = a && a.shape.points;
if (o && o.length < 2e4) {
var s = o.length, l = new Float32Array(s + i.length);
l.set(o), l.set(i, s), a.endIndex = e.end, a.setShape({
points: l
});
} else {
this._newAdded = [];
var u = this._create();
u.startIndex = e.start, u.endIndex = e.end, u.incremental = !0, u.setShape({
points: i
}), this._setCommon(u, t, n);
}
}, r.prototype.eachRendered = function(e) {
this._newAdded[0] && e(this._newAdded[0]);
}, r.prototype._create = function() {
var e = new m3({
cursor: "default"
});
return e.ignoreCoarsePointer = !0, this.group.add(e), this._newAdded.push(e), e;
}, r.prototype._setCommon = function(e, t, n) {
var a = t.hostModel;
n = n || {};
var i = t.getVisual("symbolSize");
e.setShape("size", i instanceof Array ? i : [i, i]), e.softClipShape = n.clipShape || null, e.symbolProxy = ae(t.getVisual("symbol"), 0, 0, 0, 0), e.setColor = e.symbolProxy.setColor;
var o = e.shape.size[0] < UM;
e.useStyle(
// Draw shadow when doing fillRect is extremely slow.
a.getModel("itemStyle").getItemStyle(o ? ["color", "shadowBlur", "shadowColor"] : ["color"])
);
var s = t.getVisual("style"), l = s && s.fill;
l && e.setColor(l);
var u = it(e);
u.seriesIndex = a.seriesIndex, e.on("mousemove", function(h) {
u.dataIndex = null;
var f = e.hoverDataIdx;
f >= 0 && (u.dataIndex = f + (e.startIndex || 0));
});
}, r.prototype.remove = function() {
this._clear();
}, r.prototype._clear = function() {
this._newAdded = [], this.group.removeAll();
}, r;
}()
), S3 = (
/** @class */
function(r) {
O(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t.type = e.type, t;
}
return e.prototype.render = function(t, n, a) {
var i = t.getData(), o = this._updateSymbolDraw(i, t);
o.updateData(i, {
// TODO
// If this parameter should be a shape or a bounding volume
// shape will be more general.
// But bounding volume like bounding rect will be much faster in the contain calculation
clipShape: this._getClipShape(t)
}), this._finished = !0;
}, e.prototype.incrementalPrepareRender = function(t, n, a) {
var i = t.getData(), o = this._updateSymbolDraw(i, t);
o.incrementalPrepareUpdate(i), this._finished = !1;
}, e.prototype.incrementalRender = function(t, n, a) {
this._symbolDraw.incrementalUpdate(t, n.getData(), {
clipShape: this._getClipShape(n)
}), this._finished = t.end === n.getData().count();
}, e.prototype.updateTransform = function(t, n, a) {
var i = t.getData();
if (this.group.dirty(), !this._finished || i.count() > 1e4)
return {
update: !0
};
var o = ql("").reset(t, n, a);
o.progress && o.progress({
start: 0,
end: i.count(),
count: i.count()
}, i), this._symbolDraw.updateLayout(i);
}, e.prototype.eachRendered = function(t) {
this._symbolDraw && this._symbolDraw.eachRendered(t);
}, e.prototype._getClipShape = function(t) {
if (t.get("clip", !0)) {
var n = t.coordinateSystem;
return n && n.getArea && n.getArea(0.1);
}
}, e.prototype._updateSymbolDraw = function(t, n) {
var a = this._symbolDraw, i = n.pipelineContext, o = i.large;
return (!a || o !== this._isLargeDraw) && (a && a.remove(), a = this._symbolDraw = o ? new _3() : new Zl(), this._isLargeDraw = o, this.group.removeAll()), this.group.add(a.group), a;
}, e.prototype.remove = function(t, n) {
this._symbolDraw && this._symbolDraw.remove(!0), this._symbolDraw = null;
}, e.prototype.dispose = function() {
}, e.type = "scatter", e;
}(kt)
), x3 = (
/** @class */
function(r) {
O(e, r);
function e() {
return r !== null && r.apply(this, arguments) || this;
}
return e.type = "grid", e.dependencies = ["xAxis", "yAxis"], e.layoutMode = "box", e.defaultOption = {
show: !1,
// zlevel: 0,
z: 0,
left: "10%",
top: 60,
right: "10%",
bottom: 70,
// If grid size contain label
containLabel: !1,
// width: {totalWidth} - left - right,
// height: {totalHeight} - top - bottom,
backgroundColor: "rgba(0,0,0,0)",
borderWidth: 1,
borderColor: "#ccc"
}, e;
}(_t)
), eg = (
/** @class */
function(r) {
O(e, r);
function e() {
return r !== null && r.apply(this, arguments) || this;
}
return e.prototype.getCoordSysModel = function() {
return this.getReferringComponents("grid", ne).models[0];
}, e.type = "cartesian2dAxis", e;
}(_t)
);
ie(eg, Ul);
var YM = {
show: !0,
// zlevel: 0,
z: 0,
// Inverse the axis.
inverse: !1,
// Axis name displayed.
name: "",
// 'start' | 'middle' | 'end'
nameLocation: "end",
// By degree. By default auto rotate by nameLocation.
nameRotate: null,
nameTruncate: {
maxWidth: null,
ellipsis: "...",
placeholder: "."
},
// Use global text style by default.
nameTextStyle: {},
// The gap between axisName and axisLine.
nameGap: 15,
// Default `false` to support tooltip.
silent: !1,
// Default `false` to avoid legacy user event listener fail.
triggerEvent: !1,
tooltip: {
show: !1
},
axisPointer: {},
axisLine: {
show: !0,
onZero: !0,
onZeroAxisIndex: null,
lineStyle: {
color: "#6E7079",
width: 1,
type: "solid"
},
// The arrow at both ends the the axis.
symbol: ["none", "none"],
symbolSize: [10, 15]
},
axisTick: {
show: !0,
// Whether axisTick is inside the grid or outside the grid.
inside: !1,
// The length of axisTick.
length: 5,
lineStyle: {
width: 1
}
},
axisLabel: {
show: !0,
// Whether axisLabel is inside the grid or outside the grid.
inside: !1,
rotate: 0,
// true | false | null/undefined (auto)
showMinLabel: null,
// true | false | null/undefined (auto)
showMaxLabel: null,
margin: 8,
// formatter: null,
fontSize: 12
},
splitLine: {
show: !0,
showMinLine: !0,
showMaxLine: !0,
lineStyle: {
color: ["#E0E6F1"],
width: 1,
type: "solid"
}
},
splitArea: {
show: !1,
areaStyle: {
color: ["rgba(250,250,250,0.2)", "rgba(210,219,238,0.2)"]
}
}
}, b3 = ht({
// The gap at both ends of the axis. For categoryAxis, boolean.
boundaryGap: !0,
// Set false to faster category collection.
deduplication: null,
// splitArea: {
// show: false
// },
splitLine: {
show: !1
},
axisTick: {
// If tick is align with label when boundaryGap is true
alignWithLabel: !1,
interval: "auto"
},
axisLabel: {
interval: "auto"
}
}, YM), am = ht({
boundaryGap: [0, 0],
axisLine: {
// Not shown when other axis is categoryAxis in cartesian
show: "auto"
},
axisTick: {
// Not shown when other axis is categoryAxis in cartesian
show: "auto"
},
// TODO
// min/max: [30, datamin, 60] or [20, datamin] or [datamin, 60]
splitNumber: 5,
minorTick: {
// Minor tick, not available for cateogry axis.
show: !1,
// Split number of minor ticks. The value should be in range of (0, 100)
splitNumber: 5,
// Length of minor tick
length: 3,
// Line style
lineStyle: {
// Default to be same with axisTick
}
},
minorSplitLine: {
show: !1,
lineStyle: {
color: "#F4F7FD",
width: 1
}
}
}, YM), w3 = ht({
splitNumber: 6,
axisLabel: {
// To eliminate labels that are not nice
showMinLabel: !1,
showMaxLabel: !1,
rich: {
primary: {
fontWeight: "bold"
}
}
},
splitLine: {
show: !1
}
}, am), T3 = et({
logBase: 10
}, am);
const ZM = {
category: b3,
value: am,
time: w3,
log: T3
};
var C3 = {
value: 1,
category: 1,
time: 1,
log: 1
};
function Eo(r, e, t, n) {
A(C3, function(a, i) {
var o = ht(ht({}, ZM[i], !0), n, !0), s = (
/** @class */
function(l) {
O(u, l);
function u() {
var h = l !== null && l.apply(this, arguments) || this;
return h.type = e + "Axis." + i, h;
}
return u.prototype.mergeDefaultAndTheme = function(h, f) {
var c = pl(this), v = c ? $o(h) : {}, p = f.getTheme();
ht(h, p.get(i + "Axis")), ht(h, this.getDefaultOption()), h.type = kS(h), c && pa(h, v, c);
}, u.prototype.optionUpdated = function() {
var h = this.option;
h.type === "category" && (this.__ordinalMeta = Xd.createByAxisModel(this));
}, u.prototype.getCategories = function(h) {
var f = this.option;
if (f.type === "category")
return h ? f.data : this.__ordinalMeta.categories;
}, u.prototype.getOrdinalMeta = function() {
return this.__ordinalMeta;
}, u.type = e + "Axis." + i, u.defaultOption = o, u;
}(t)
);
r.registerComponentModel(s);
}), r.registerSubTypeDefaulter(e + "Axis", kS);
}
function kS(r) {
return r.type || (r.data ? "category" : "value");
}
var D3 = (
/** @class */
function() {
function r(e) {
this.type = "cartesian", this._dimList = [], this._axes = {}, this.name = e || "";
}
return r.prototype.getAxis = function(e) {
return this._axes[e];
}, r.prototype.getAxes = function() {
return G(this._dimList, function(e) {
return this._axes[e];
}, this);
}, r.prototype.getAxesByScale = function(e) {
return e = e.toLowerCase(), At(this.getAxes(), function(t) {
return t.scale.type === e;
});
}, r.prototype.addAxis = function(e) {
var t = e.dim;
this._axes[t] = e, this._dimList.push(t);
}, r;
}()
), rg = ["x", "y"];
function RS(r) {
return r.type === "interval" || r.type === "time";
}
var A3 = (
/** @class */
function(r) {
O(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t.type = "cartesian2d", t.dimensions = rg, t;
}
return e.prototype.calcAffineTransform = function() {
this._transform = this._invTransform = null;
var t = this.getAxis("x").scale, n = this.getAxis("y").scale;
if (!(!RS(t) || !RS(n))) {
var a = t.getExtent(), i = n.getExtent(), o = this.dataToPoint([a[0], i[0]]), s = this.dataToPoint([a[1], i[1]]), l = a[1] - a[0], u = i[1] - i[0];
if (!(!l || !u)) {
var h = (s[0] - o[0]) / l, f = (s[1] - o[1]) / u, c = o[0] - a[0] * h, v = o[1] - i[0] * f, p = this._transform = [h, 0, 0, f, c, v];
this._invTransform = Vo([], p);
}
}
}, e.prototype.getBaseAxis = function() {
return this.getAxesByScale("ordinal")[0] || this.getAxesByScale("time")[0] || this.getAxis("x");
}, e.prototype.containPoint = function(t) {
var n = this.getAxis("x"), a = this.getAxis("y");
return n.contain(n.toLocalCoord(t[0])) && a.contain(a.toLocalCoord(t[1]));
}, e.prototype.containData = function(t) {
return this.getAxis("x").containData(t[0]) && this.getAxis("y").containData(t[1]);
}, e.prototype.containZone = function(t, n) {
var a = this.dataToPoint(t), i = this.dataToPoint(n), o = this.getArea(), s = new ct(a[0], a[1], i[0] - a[0], i[1] - a[1]);
return o.intersect(s);
}, e.prototype.dataToPoint = function(t, n, a) {
a = a || [];
var i = t[0], o = t[1];
if (this._transform && i != null && isFinite(i) && o != null && isFinite(o))
return me(a, t, this._transform);
var s = this.getAxis("x"), l = this.getAxis("y");
return a[0] = s.toGlobalCoord(s.dataToCoord(i, n)), a[1] = l.toGlobalCoord(l.dataToCoord(o, n)), a;
}, e.prototype.clampData = function(t, n) {
var a = this.getAxis("x").scale, i = this.getAxis("y").scale, o = a.getExtent(), s = i.getExtent(), l = a.parse(t[0]), u = i.parse(t[1]);
return n = n || [], n[0] = Math.min(Math.max(Math.min(o[0], o[1]), l), Math.max(o[0], o[1])), n[1] = Math.min(Math.max(Math.min(s[0], s[1]), u), Math.max(s[0], s[1])), n;
}, e.prototype.pointToData = function(t, n) {
var a = [];
if (this._invTransform)
return me(a, t, this._invTransform);
var i = this.getAxis("x"), o = this.getAxis("y");
return a[0] = i.coordToData(i.toLocalCoord(t[0]), n), a[1] = o.coordToData(o.toLocalCoord(t[1]), n), a;
}, e.prototype.getOtherAxis = function(t) {
return this.getAxis(t.dim === "x" ? "y" : "x");
}, e.prototype.getArea = function(t) {
t = t || 0;
var n = this.getAxis("x").getGlobalExtent(), a = this.getAxis("y").getGlobalExtent(), i = Math.min(n[0], n[1]) - t, o = Math.min(a[0], a[1]) - t, s = Math.max(n[0], n[1]) - i + t, l = Math.max(a[0], a[1]) - o + t;
return new ct(i, o, s, l);
}, e;
}(D3)
), M3 = (
/** @class */
function(r) {
O(e, r);
function e(t, n, a, i, o) {
var s = r.call(this, t, n, a) || this;
return s.index = 0, s.type = i || "value", s.position = o || "bottom", s;
}
return e.prototype.isHorizontal = function() {
var t = this.position;
return t === "top" || t === "bottom";
}, e.prototype.getGlobalExtent = function(t) {
var n = this.getExtent();
return n[0] = this.toGlobalCoord(n[0]), n[1] = this.toGlobalCoord(n[1]), t && n[0] > n[1] && n.reverse(), n;
}, e.prototype.pointToData = function(t, n) {
return this.coordToData(this.toLocalCoord(t[this.dim === "x" ? 0 : 1]), n);
}, e.prototype.setCategorySortInfo = function(t) {
if (this.type !== "category")
return !1;
this.model.option.categorySortInfo = t, this.scale.setSortInfo(t);
}, e;
}(Br)
);
function ng(r, e, t) {
t = t || {};
var n = r.coordinateSystem, a = e.axis, i = {}, o = a.getAxesOnZeroOf()[0], s = a.position, l = o ? "onZero" : s, u = a.dim, h = n.getRect(), f = [h.x, h.x + h.width, h.y, h.y + h.height], c = {
left: 0,
right: 1,
top: 0,
bottom: 1,
onZero: 2
}, v = e.get("offset") || 0, p = u === "x" ? [f[2] - v, f[3] + v] : [f[0] - v, f[1] + v];
if (o) {
var d = o.toGlobalCoord(o.dataToCoord(0));
p[c.onZero] = Math.max(Math.min(d, p[1]), p[0]);
}
i.position = [u === "y" ? p[c[l]] : f[0], u === "x" ? p[c[l]] : f[3]], i.rotation = Math.PI / 2 * (u === "x" ? 0 : 1);
var g = {
top: -1,
bottom: 1,
left: -1,
right: 1
};
i.labelDirection = i.tickDirection = i.nameDirection = g[s], i.labelOffset = o ? p[c[s]] - p[c.onZero] : 0, e.get(["axisTick", "inside"]) && (i.tickDirection = -i.tickDirection), re(t.labelInside, e.get(["axisLabel", "inside"])) && (i.labelDirection = -i.labelDirection);
var y = e.get(["axisLabel", "rotate"]);
return i.labelRotate = l === "top" ? -y : y, i.z2 = 1, i;
}
function NS(r) {
return r.get("coordinateSystem") === "cartesian2d";
}
function OS(r) {
var e = {
xAxisModel: null,
yAxisModel: null
};
return A(e, function(t, n) {
var a = n.replace(/Model$/, ""), i = r.getReferringComponents(a, ne).models[0];
if (process.env.NODE_ENV !== "production" && !i)
throw new Error(a + ' "' + mr(r.get(a + "Index"), r.get(a + "Id"), 0) + '" not found');
e[n] = i;
}), e;
}
var Fv = Math.log;
function XM(r, e, t) {
var n = En.prototype, a = n.getTicks.call(t), i = n.getTicks.call(t, !0), o = a.length - 1, s = n.getInterval.call(t), l = jA(r, e), u = l.extent, h = l.fixMin, f = l.fixMax;
if (r.type === "log") {
var c = Fv(r.base);
u = [Fv(u[0]) / c, Fv(u[1]) / c];
}
r.setExtent(u[0], u[1]), r.calcNiceExtent({
splitNumber: o,
fixMin: h,
fixMax: f
});
var v = n.getExtent.call(r);
h && (u[0] = v[0]), f && (u[1] = v[1]);
var p = n.getInterval.call(r), d = u[0], g = u[1];
if (h && f)
p = (g - d) / o;
else if (h)
for (g = u[0] + p * o; g < u[1] && isFinite(g) && isFinite(u[1]); )
p = Dv(p), g = u[0] + p * o;
else if (f)
for (d = u[1] - p * o; d > u[0] && isFinite(d) && isFinite(u[0]); )
p = Dv(p), d = u[1] - p * o;
else {
var y = r.getTicks().length - 1;
y > o && (p = Dv(p));
var m = p * o;
g = Math.ceil(u[1] / p) * p, d = jt(g - m), d < 0 && u[0] >= 0 ? (d = 0, g = jt(m)) : g > 0 && u[1] <= 0 && (g = 0, d = -jt(m));
}
var _ = (a[0].value - i[0].value) / s, S = (a[o].value - i[o].value) / s;
if (n.setExtent.call(r, d + p * _, g + p * S), n.setInterval.call(r, p), (_ || S) && n.setNiceExtent.call(r, d + p, g - p), process.env.NODE_ENV !== "production") {
var x = n.getTicks.call(r);
x[1] && (!zB(p) || _d(x[1].value) > _d(p)) && Zt(
// eslint-disable-next-line
"The ticks may be not readable when set min: " + e.get("min") + ", max: " + e.get("max") + " and alignTicks: true"
);
}
}
var I3 = (
/** @class */
function() {
function r(e, t, n) {
this.type = "grid", this._coordsMap = {}, this._coordsList = [], this._axesMap = {}, this._axesList = [], this.axisPointerEnabled = !0, this.dimensions = rg, this._initCartesian(e, t, n), this.model = e;
}
return r.prototype.getRect = function() {
return this._rect;
}, r.prototype.update = function(e, t) {
var n = this._axesMap;
this._updateScale(e, this.model);
function a(o) {
var s, l = St(o), u = l.length;
if (u) {
for (var h = [], f = u - 1; f >= 0; f--) {
var c = +l[f], v = o[c], p = v.model, d = v.scale;
// Only value and log axis without interval support alignTicks.
qd(d) && p.get("alignTicks") && p.get("interval") == null ? h.push(v) : (Io(d, p), qd(d) && (s = v));
}
h.length && (s || (s = h.pop(), Io(s.scale, s.model)), A(h, function(g) {
XM(g.scale, g.model, s.scale);
}));
}
}
a(n.x), a(n.y);
var i = {};
A(n.x, function(o) {
VS(n, "y", o, i);
}), A(n.y, function(o) {
VS(n, "x", o, i);
}), this.resize(this.model, t);
}, r.prototype.resize = function(e, t, n) {
var a = e.getBoxLayoutParams(), i = !n && e.get("containLabel"), o = se(a, {
width: t.getWidth(),
height: t.getHeight()
});
this._rect = o;
var s = this._axesList;
l(), i && (A(s, function(u) {
if (!u.model.get(["axisLabel", "inside"])) {
var h = uz(u);
if (h) {
var f = u.isHorizontal() ? "height" : "width", c = u.model.get(["axisLabel", "margin"]);
o[f] -= h[f] + c, u.position === "top" ? o.y += h.height + c : u.position === "left" && (o.x += h.width + c);
}
}
}), l()), A(this._coordsList, function(u) {
u.calcAffineTransform();
});
function l() {
A(s, function(u) {
var h = u.isHorizontal(), f = h ? [0, o.width] : [0, o.height], c = u.inverse ? 1 : 0;
u.setExtent(f[c], f[1 - c]), L3(u, h ? o.x : o.y);
});
}
}, r.prototype.getAxis = function(e, t) {
var n = this._axesMap[e];
if (n != null)
return n[t || 0];
}, r.prototype.getAxes = function() {
return this._axesList.slice();
}, r.prototype.getCartesian = function(e, t) {
if (e != null && t != null) {
var n = "x" + e + "y" + t;
return this._coordsMap[n];
}
J(e) && (t = e.yAxisIndex, e = e.xAxisIndex);
for (var a = 0, i = this._coordsList; a < i.length; a++)
if (i[a].getAxis("x").index === e || i[a].getAxis("y").index === t)
return i[a];
}, r.prototype.getCartesians = function() {
return this._coordsList.slice();
}, r.prototype.convertToPixel = function(e, t, n) {
var a = this._findConvertTarget(t);
return a.cartesian ? a.cartesian.dataToPoint(n) : a.axis ? a.axis.toGlobalCoord(a.axis.dataToCoord(n)) : null;
}, r.prototype.convertFromPixel = function(e, t, n) {
var a = this._findConvertTarget(t);
return a.cartesian ? a.cartesian.pointToData(n) : a.axis ? a.axis.coordToData(a.axis.toLocalCoord(n)) : null;
}, r.prototype._findConvertTarget = function(e) {
var t = e.seriesModel, n = e.xAxisModel || t && t.getReferringComponents("xAxis", ne).models[0], a = e.yAxisModel || t && t.getReferringComponents("yAxis", ne).models[0], i = e.gridModel, o = this._coordsList, s, l;
if (t)
s = t.coordinateSystem, pt(o, s) < 0 && (s = null);
else if (n && a)
s = this.getCartesian(n.componentIndex, a.componentIndex);
else if (n)
l = this.getAxis("x", n.componentIndex);
else if (a)
l = this.getAxis("y", a.componentIndex);
else if (i) {
var u = i.coordinateSystem;
u === this && (s = this._coordsList[0]);
}
return {
cartesian: s,
axis: l
};
}, r.prototype.containPoint = function(e) {
var t = this._coordsList[0];
if (t)
return t.containPoint(e);
}, r.prototype._initCartesian = function(e, t, n) {
var a = this, i = this, o = {
left: !1,
right: !1,
top: !1,
bottom: !1
}, s = {
x: {},
y: {}
}, l = {
x: 0,
y: 0
};
if (t.eachComponent("xAxis", u("x"), this), t.eachComponent("yAxis", u("y"), this), !l.x || !l.y) {
this._axesMap = {}, this._axesList = [];
return;
}
this._axesMap = s, A(s.x, function(h, f) {
A(s.y, function(c, v) {
var p = "x" + f + "y" + v, d = new A3(p);
d.master = a, d.model = e, a._coordsMap[p] = d, a._coordsList.push(d), d.addAxis(h), d.addAxis(c);
});
});
function u(h) {
return function(f, c) {
if (Hv(f, e)) {
var v = f.get("position");
h === "x" ? v !== "top" && v !== "bottom" && (v = o.bottom ? "top" : "bottom") : v !== "left" && v !== "right" && (v = o.left ? "right" : "left"), o[v] = !0;
var p = new M3(h, hc(f), [0, 0], f.get("type"), v), d = p.type === "category";
p.onBand = d && f.get("boundaryGap"), p.inverse = f.get("inverse"), f.axis = p, p.model = f, p.grid = i, p.index = c, i._axesList.push(p), s[h][c] = p, l[h]++;
}
};
}
}, r.prototype._updateScale = function(e, t) {
A(this._axesList, function(a) {
if (a.scale.setExtent(1 / 0, -1 / 0), a.type === "category") {
var i = a.model.get("categorySortInfo");
a.scale.setSortInfo(i);
}
}), e.eachSeries(function(a) {
if (NS(a)) {
var i = OS(a), o = i.xAxisModel, s = i.yAxisModel;
if (!Hv(o, t) || !Hv(s, t))
return;
var l = this.getCartesian(o.componentIndex, s.componentIndex), u = a.getData(), h = l.getAxis("x"), f = l.getAxis("y");
n(u, h), n(u, f);
}
}, this);
function n(a, i) {
A(ef(a, i.dim), function(o) {
i.scale.unionExtentFromData(a, o);
});
}
}, r.prototype.getTooltipAxes = function(e) {
var t = [], n = [];
return A(this.getCartesians(), function(a) {
var i = e != null && e !== "auto" ? a.getAxis(e) : a.getBaseAxis(), o = a.getOtherAxis(i);
pt(t, i) < 0 && t.push(i), pt(n, o) < 0 && n.push(o);
}), {
baseAxes: t,
otherAxes: n
};
}, r.create = function(e, t) {
var n = [];
return e.eachComponent("grid", function(a, i) {
var o = new r(a, e, t);
o.name = "grid_" + i, o.resize(a, t, !0), a.coordinateSystem = o, n.push(o);
}), e.eachSeries(function(a) {
if (NS(a)) {
var i = OS(a), o = i.xAxisModel, s = i.yAxisModel, l = o.getCoordSysModel();
if (process.env.NODE_ENV !== "production") {
if (!l)
throw new Error('Grid "' + mr(o.get("gridIndex"), o.get("gridId"), 0) + '" not found');
if (o.getCoordSysModel() !== s.getCoordSysModel())
throw new Error("xAxis and yAxis must use the same grid");
}
var u = l.coordinateSystem;
a.coordinateSystem = u.getCartesian(o.componentIndex, s.componentIndex);
}
}), n;
}, r.dimensions = rg, r;
}()
);
function Hv(r, e) {
return r.getCoordSysModel() === e;
}
function VS(r, e, t, n) {
t.getAxesOnZeroOf = function() {
return i ? [i] : [];
};
var a = r[e], i, o = t.model, s = o.get(["axisLine", "onZero"]), l = o.get(["axisLine", "onZeroAxisIndex"]);
if (!s)
return;
if (l != null)
BS(a[l]) && (i = a[l]);
else
for (var u in a)
if (a.hasOwnProperty(u) && BS(a[u]) && !n[h(a[u])]) {
i = a[u];
break;
}
i && (n[h(i)] = !0);
function h(f) {
return f.dim + "_" + f.index;
}
}
function BS(r) {
return r && r.type !== "category" && r.type !== "time" && lz(r);
}
function L3(r, e) {
var t = r.getExtent(), n = t[0] + t[1];
r.toGlobalCoord = r.dim === "x" ? function(a) {
return a + e;
} : function(a) {
return n - a + e;
}, r.toLocalCoord = r.dim === "x" ? function(a) {
return a - e;
} : function(a) {
return n - a + e;
};
}
var na = Math.PI, Oe = (
/** @class */
function() {
function r(e, t) {
this.group = new at(), this.opt = t, this.axisModel = e, et(t, {
labelOffset: 0,
nameDirection: 1,
tickDirection: 1,
labelDirection: 1,
silent: !0,
handleAutoShown: function() {
return !0;
}
});
var n = new at({
x: t.position[0],
y: t.position[1],
rotation: t.rotation
});
n.updateTransform(), this._transformGroup = n;
}
return r.prototype.hasBuilder = function(e) {
return !!zS[e];
}, r.prototype.add = function(e) {
zS[e](this.opt, this.axisModel, this.group, this._transformGroup);
}, r.prototype.getGroup = function() {
return this.group;
}, r.innerTextLayout = function(e, t, n) {
var a = pC(t - e), i, o;
return hl(a) ? (o = n > 0 ? "top" : "bottom", i = "center") : hl(a - na) ? (o = n > 0 ? "bottom" : "top", i = "center") : (o = "middle", a > 0 && a < na ? i = n > 0 ? "right" : "left" : i = n > 0 ? "left" : "right"), {
rotation: a,
textAlign: i,
textVerticalAlign: o
};
}, r.makeAxisEventDataBase = function(e) {
var t = {
componentType: e.mainType,
componentIndex: e.componentIndex
};
return t[e.mainType + "Index"] = e.componentIndex, t;
}, r.isLabelSilent = function(e) {
var t = e.get("tooltip");
return e.get("silent") || !(e.get("triggerEvent") || t && t.show);
}, r;
}()
), zS = {
axisLine: function(r, e, t, n) {
var a = e.get(["axisLine", "show"]);
if (a === "auto" && r.handleAutoShown && (a = r.handleAutoShown("axisLine")), !!a) {
var i = e.axis.getExtent(), o = n.transform, s = [i[0], 0], l = [i[1], 0], u = s[0] > l[0];
o && (me(s, s, o), me(l, l, o));
var h = B({
lineCap: "round"
}, e.getModel(["axisLine", "lineStyle"]).getLineStyle()), f = new he({
shape: {
x1: s[0],
y1: s[1],
x2: l[0],
y2: l[1]
},
style: h,
strokeContainThreshold: r.strokeContainThreshold || 5,
silent: !0,
z2: 1
});
Do(f.shape, f.style.lineWidth), f.anid = "line", t.add(f);
var c = e.get(["axisLine", "symbol"]);
if (c != null) {
var v = e.get(["axisLine", "symbolSize"]);
U(c) && (c = [c, c]), (U(v) || Tt(v)) && (v = [v, v]);
var p = ki(e.get(["axisLine", "symbolOffset"]) || 0, v), d = v[0], g = v[1];
A([{
rotate: r.rotation + Math.PI / 2,
offset: p[0],
r: 0
}, {
rotate: r.rotation - Math.PI / 2,
offset: p[1],
r: Math.sqrt((s[0] - l[0]) * (s[0] - l[0]) + (s[1] - l[1]) * (s[1] - l[1]))
}], function(y, m) {
if (c[m] !== "none" && c[m] != null) {
var _ = ae(c[m], -d / 2, -g / 2, d, g, h.stroke, !0), S = y.r + y.offset, x = u ? l : s;
_.attr({
rotation: y.rotate,
x: x[0] + S * Math.cos(r.rotation),
y: x[1] - S * Math.sin(r.rotation),
silent: !0,
z2: 11
}), t.add(_);
}
});
}
}
},
axisTickLabel: function(r, e, t, n) {
var a = k3(t, n, e, r), i = N3(t, n, e, r);
if (P3(e, i, a), R3(t, n, e, r.tickDirection), e.get(["axisLabel", "hideOverlap"])) {
var o = fM(G(i, function(s) {
return {
label: s,
priority: s.z2,
defaultAttr: {
ignore: s.ignore
}
};
}));
pM(o);
}
},
axisName: function(r, e, t, n) {
var a = re(r.axisName, e.get("name"));
if (a) {
var i = e.get("nameLocation"), o = r.nameDirection, s = e.getModel("nameTextStyle"), l = e.get("nameGap") || 0, u = e.axis.getExtent(), h = u[0] > u[1] ? -1 : 1, f = [
i === "start" ? u[0] - h * l : i === "end" ? u[1] + h * l : (u[0] + u[1]) / 2,
// Reuse labelOffset.
FS(i) ? r.labelOffset + o * l : 0
], c, v = e.get("nameRotate");
v != null && (v = v * na / 180);
var p;
FS(i) ? c = Oe.innerTextLayout(
r.rotation,
v ?? r.rotation,
// Adapt to axis.
o
) : (c = E3(r.rotation, i, v || 0, u), p = r.axisNameAvailableWidth, p != null && (p = Math.abs(p / Math.sin(c.rotation)), !isFinite(p) && (p = null)));
var d = s.getFont(), g = e.get("nameTruncate", !0) || {}, y = g.ellipsis, m = re(r.nameTruncateMaxWidth, g.maxWidth, p), _ = new wt({
x: f[0],
y: f[1],
rotation: c.rotation,
silent: Oe.isLabelSilent(e),
style: Gt(s, {
text: a,
font: d,
overflow: "truncate",
width: m,
ellipsis: y,
fill: s.getTextColor() || e.get(["axisLine", "lineStyle", "color"]),
align: s.get("align") || c.textAlign,
verticalAlign: s.get("verticalAlign") || c.textVerticalAlign
}),
z2: 1
});
if (Ei({
el: _,
componentModel: e,
itemName: a
}), _.__fullText = a, _.anid = "name", e.get("triggerEvent")) {
var S = Oe.makeAxisEventDataBase(e);
S.targetType = "axisName", S.name = a, it(_).eventData = S;
}
n.add(_), _.updateTransform(), t.add(_), _.decomposeTransform();
}
}
};
function E3(r, e, t, n) {
var a = pC(t - r), i, o, s = n[0] > n[1], l = e === "start" && !s || e !== "start" && s;
return hl(a - na / 2) ? (o = l ? "bottom" : "top", i = "center") : hl(a - na * 1.5) ? (o = l ? "top" : "bottom", i = "center") : (o = "middle", a < na * 1.5 && a > na / 2 ? i = l ? "left" : "right" : i = l ? "right" : "left"), {
rotation: a,
textAlign: i,
textVerticalAlign: o
};
}
function P3(r, e, t) {
if (!QA(r.axis)) {
var n = r.get(["axisLabel", "showMinLabel"]), a = r.get(["axisLabel", "showMaxLabel"]);
e = e || [], t = t || [];
var i = e[0], o = e[1], s = e[e.length - 1], l = e[e.length - 2], u = t[0], h = t[1], f = t[t.length - 1], c = t[t.length - 2];
n === !1 ? (ir(i), ir(u)) : GS(i, o) && (n ? (ir(o), ir(h)) : (ir(i), ir(u))), a === !1 ? (ir(s), ir(f)) : GS(l, s) && (a ? (ir(l), ir(c)) : (ir(s), ir(f)));
}
}
function ir(r) {
r && (r.ignore = !0);
}
function GS(r, e) {
var t = r && r.getBoundingRect().clone(), n = e && e.getBoundingRect().clone();
if (!(!t || !n)) {
var a = kf([]);
return Li(a, a, -r.rotation), t.applyTransform(xn([], a, r.getLocalTransform())), n.applyTransform(xn([], a, e.getLocalTransform())), t.intersect(n);
}
}
function FS(r) {
return r === "middle" || r === "center";
}
function qM(r, e, t, n, a) {
for (var i = [], o = [], s = [], l = 0; l < r.length; l++) {
var u = r[l].coord;
o[0] = u, o[1] = 0, s[0] = u, s[1] = t, e && (me(o, o, e), me(s, s, e));
var h = new he({
shape: {
x1: o[0],
y1: o[1],
x2: s[0],
y2: s[1]
},
style: n,
z2: 2,
autoBatch: !0,
silent: !0
});
Do(h.shape, h.style.lineWidth), h.anid = a + "_" + r[l].tickValue, i.push(h);
}
return i;
}
function k3(r, e, t, n) {
var a = t.axis, i = t.getModel("axisTick"), o = i.get("show");
if (o === "auto" && n.handleAutoShown && (o = n.handleAutoShown("axisTick")), !(!o || a.scale.isBlank())) {
for (var s = i.getModel("lineStyle"), l = n.tickDirection * i.get("length"), u = a.getTicksCoords(), h = qM(u, e.transform, l, et(s.getLineStyle(), {
stroke: t.get(["axisLine", "lineStyle", "color"])
}), "ticks"), f = 0; f < h.length; f++)
r.add(h[f]);
return h;
}
}
function R3(r, e, t, n) {
var a = t.axis, i = t.getModel("minorTick");
if (!(!i.get("show") || a.scale.isBlank())) {
var o = a.getMinorTicksCoords();
if (o.length)
for (var s = i.getModel("lineStyle"), l = n * i.get("length"), u = et(s.getLineStyle(), et(t.getModel("axisTick").getLineStyle(), {
stroke: t.get(["axisLine", "lineStyle", "color"])
})), h = 0; h < o.length; h++)
for (var f = qM(o[h], e.transform, l, u, "minorticks_" + h), c = 0; c < f.length; c++)
r.add(f[c]);
}
}
function N3(r, e, t, n) {
var a = t.axis, i = re(n.axisLabelShow, t.get(["axisLabel", "show"]));
if (!(!i || a.scale.isBlank())) {
var o = t.getModel("axisLabel"), s = o.get("margin"), l = a.getViewLabels(), u = (re(n.labelRotate, o.get("rotate")) || 0) * na / 180, h = Oe.innerTextLayout(n.rotation, u, n.labelDirection), f = t.getCategories && t.getCategories(!0), c = [], v = Oe.isLabelSilent(t), p = t.get("triggerEvent");
return A(l, function(d, g) {
var y = a.scale.type === "ordinal" ? a.scale.getRawOrdinalNumber(d.tickValue) : d.tickValue, m = d.formattedLabel, _ = d.rawLabel, S = o;
if (f && f[y]) {
var x = f[y];
J(x) && x.textStyle && (S = new It(x.textStyle, o, t.ecModel));
}
var b = S.getTextColor() || t.get(["axisLine", "lineStyle", "color"]), w = a.dataToCoord(y), T = S.getShallow("align", !0) || h.textAlign, C = ot(S.getShallow("alignMinLabel", !0), T), D = ot(S.getShallow("alignMaxLabel", !0), T), M = S.getShallow("verticalAlign", !0) || S.getShallow("baseline", !0) || h.textVerticalAlign, I = ot(S.getShallow("verticalAlignMinLabel", !0), M), L = ot(S.getShallow("verticalAlignMaxLabel", !0), M), E = new wt({
x: w,
y: n.labelOffset + n.labelDirection * s,
rotation: h.rotation,
silent: v,
z2: 10 + (d.level || 0),
style: Gt(S, {
text: m,
align: g === 0 ? C : g === l.length - 1 ? D : T,
verticalAlign: g === 0 ? I : g === l.length - 1 ? L : M,
fill: K(b) ? b(
// (1) In category axis with data zoom, tick is not the original
// index of axis.data. So tick should not be exposed to user
// in category axis.
// (2) Compatible with previous version, which always use formatted label as
// input. But in interval scale the formatted label is like '223,445', which
// maked user replace ','. So we modify it to return original val but remain
// it as 'string' to avoid error in replacing.
a.type === "category" ? _ : a.type === "value" ? y + "" : y,
g
) : b
})
});
if (E.anid = "label_" + y, Ei({
el: E,
componentModel: t,
itemName: m,
formatterParamsExtra: {
isTruncated: function() {
return E.isTruncated;
},
value: _,
tickIndex: g
}
}), p) {
var P = Oe.makeAxisEventDataBase(t);
P.targetType = "axisLabel", P.value = _, P.tickIndex = g, a.type === "category" && (P.dataIndex = y), it(E).eventData = P;
}
e.add(E), E.updateTransform(), c.push(E), r.add(E), E.decomposeTransform();
}), c;
}
}
function O3(r, e) {
var t = {
/**
* key: makeKey(axis.model)
* value: {
* axis,
* coordSys,
* axisPointerModel,
* triggerTooltip,
* triggerEmphasis,
* involveSeries,
* snap,
* seriesModels,
* seriesDataCount
* }
*/
axesInfo: {},
seriesInvolved: !1,
/**
* key: makeKey(coordSys.model)
* value: Object: key makeKey(axis.model), value: axisInfo
*/
coordSysAxesInfo: {},
coordSysMap: {}
};
return V3(t, r, e), t.seriesInvolved && z3(t, r), t;
}
function V3(r, e, t) {
var n = e.getComponent("tooltip"), a = e.getComponent("axisPointer"), i = a.get("link", !0) || [], o = [];
A(t.getCoordinateSystems(), function(s) {
if (!s.axisPointerEnabled)
return;
var l = wl(s.model), u = r.coordSysAxesInfo[l] = {};
r.coordSysMap[l] = s;
var h = s.model, f = h.getModel("tooltip", n);
if (A(s.getAxes(), ut(d, !1, null)), s.getTooltipAxes && n && f.get("show")) {
var c = f.get("trigger") === "axis", v = f.get(["axisPointer", "type"]) === "cross", p = s.getTooltipAxes(f.get(["axisPointer", "axis"]));
(c || v) && A(p.baseAxes, ut(d, v ? "cross" : !0, c)), v && A(p.otherAxes, ut(d, "cross", !1));
}
function d(g, y, m) {
var _ = m.model.getModel("axisPointer", a), S = _.get("show");
if (!(!S || S === "auto" && !g && !ag(_))) {
y == null && (y = _.get("triggerTooltip")), _ = g ? B3(m, f, a, e, g, y) : _;
var x = _.get("snap"), b = _.get("triggerEmphasis"), w = wl(m.model), T = y || x || m.type === "category", C = r.axesInfo[w] = {
key: w,
axis: m,
coordSys: s,
axisPointerModel: _,
triggerTooltip: y,
triggerEmphasis: b,
involveSeries: T,
snap: x,
useHandle: ag(_),
seriesModels: [],
linkGroup: null
};
u[w] = C, r.seriesInvolved = r.seriesInvolved || T;
var D = G3(i, m);
if (D != null) {
var M = o[D] || (o[D] = {
axesInfo: {}
});
M.axesInfo[w] = C, M.mapper = i[D].mapper, C.linkGroup = M;
}
}
}
});
}
function B3(r, e, t, n, a, i) {
var o = e.getModel("axisPointer"), s = ["type", "snap", "lineStyle", "shadowStyle", "label", "animation", "animationDurationUpdate", "animationEasingUpdate", "z"], l = {};
A(s, function(c) {
l[c] = nt(o.get(c));
}), l.snap = r.type !== "category" && !!i, o.get("type") === "cross" && (l.type = "line");
var u = l.label || (l.label = {});
if (u.show == null && (u.show = !1), a === "cross") {
var h = o.get(["label", "show"]);
if (u.show = h ?? !0, !i) {
var f = l.lineStyle = o.get("crossStyle");
f && et(u, f.textStyle);
}
}
return r.model.getModel("axisPointer", new It(l, t, n));
}
function z3(r, e) {
e.eachSeries(function(t) {
var n = t.coordinateSystem, a = t.get(["tooltip", "trigger"], !0), i = t.get(["tooltip", "show"], !0);
!n || a === "none" || a === !1 || a === "item" || i === !1 || t.get(["axisPointer", "show"], !0) === !1 || A(r.coordSysAxesInfo[wl(n.model)], function(o) {
var s = o.axis;
n.getAxis(s.dim) === s && (o.seriesModels.push(t), o.seriesDataCount == null && (o.seriesDataCount = 0), o.seriesDataCount += t.getData().count());
});
});
}
function G3(r, e) {
for (var t = e.model, n = e.dim, a = 0; a < r.length; a++) {
var i = r[a] || {};
if (Wv(i[n + "AxisId"], t.id) || Wv(i[n + "AxisIndex"], t.componentIndex) || Wv(i[n + "AxisName"], t.name))
return a;
}
}
function Wv(r, e) {
return r === "all" || z(r) && pt(r, e) >= 0 || r === e;
}
function F3(r) {
var e = im(r);
if (e) {
var t = e.axisPointerModel, n = e.axis.scale, a = t.option, i = t.get("status"), o = t.get("value");
o != null && (o = n.parse(o));
var s = ag(t);
i == null && (a.status = s ? "show" : "hide");
var l = n.getExtent().slice();
l[0] > l[1] && l.reverse(), // Pick a value on axis when initializing.
(o == null || o > l[1]) && (o = l[1]), o < l[0] && (o = l[0]), a.value = o, s && (a.status = e.axis.scale.isBlank() ? "hide" : "show");
}
}
function im(r) {
var e = (r.ecModel.getComponent("axisPointer") || {}).coordSysAxesInfo;
return e && e.axesInfo[wl(r)];
}
function H3(r) {
var e = im(r);
return e && e.axisPointerModel;
}
function ag(r) {
return !!r.get(["handle", "show"]);
}
function wl(r) {
return r.type + "||" + r.id;
}
var $v = {}, Oi = (
/** @class */
function(r) {
O(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t.type = e.type, t;
}
return e.prototype.render = function(t, n, a, i) {
this.axisPointerClass && F3(t), r.prototype.render.apply(this, arguments), this._doUpdateAxisPointerClass(t, a, !0);
}, e.prototype.updateAxisPointer = function(t, n, a, i) {
this._doUpdateAxisPointerClass(t, a, !1);
}, e.prototype.remove = function(t, n) {
var a = this._axisPointer;
a && a.remove(n);
}, e.prototype.dispose = function(t, n) {
this._disposeAxisPointer(n), r.prototype.dispose.apply(this, arguments);
}, e.prototype._doUpdateAxisPointerClass = function(t, n, a) {
var i = e.getAxisPointerClass(this.axisPointerClass);
if (i) {
var o = H3(t);
o ? (this._axisPointer || (this._axisPointer = new i())).render(t, o, n, a) : this._disposeAxisPointer(n);
}
}, e.prototype._disposeAxisPointer = function(t) {
this._axisPointer && this._axisPointer.dispose(t), this._axisPointer = null;
}, e.registerAxisPointerClass = function(t, n) {
if (process.env.NODE_ENV !== "production" && $v[t])
throw new Error("axisPointer " + t + " exists");
$v[t] = n;
}, e.getAxisPointerClass = function(t) {
return t && $v[t];
}, e.type = "axis", e;
}(Yt)
), ig = bt();
function KM(r, e, t, n) {
var a = t.axis;
if (!a.scale.isBlank()) {
var i = t.getModel("splitArea"), o = i.getModel("areaStyle"), s = o.get("color"), l = n.coordinateSystem.getRect(), u = a.getTicksCoords({
tickModel: i,
clamp: !0
});
if (u.length) {
var h = s.length, f = ig(r).splitAreaColors, c = X(), v = 0;
if (f)
for (var p = 0; p < u.length; p++) {
var d = f.get(u[p].tickValue);
if (d != null) {
v = (d + (h - 1) * p) % h;
break;
}
}
var g = a.toGlobalCoord(u[0].coord), y = o.getAreaStyle();
s = z(s) ? s : [s];
for (var p = 1; p < u.length; p++) {
var m = a.toGlobalCoord(u[p].coord), _ = void 0, S = void 0, x = void 0, b = void 0;
a.isHorizontal() ? (_ = g, S = l.y, x = m - _, b = l.height, g = _ + x) : (_ = l.x, S = g, x = l.width, b = m - S, g = S + b);
var w = u[p - 1].tickValue;
w != null && c.set(w, v), e.add(new xt({
anid: w != null ? "area_" + w : null,
shape: {
x: _,
y: S,
width: x,
height: b
},
style: et({
fill: s[v]
}, y),
autoBatch: !0,
silent: !0
})), v = (v + 1) % h;
}
ig(r).splitAreaColors = c;
}
}
}
function jM(r) {
ig(r).splitAreaColors = null;
}
var W3 = ["axisLine", "axisTickLabel", "axisName"], $3 = ["splitArea", "splitLine", "minorSplitLine"], QM = (
/** @class */
function(r) {
O(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t.type = e.type, t.axisPointerClass = "CartesianAxisPointer", t;
}
return e.prototype.render = function(t, n, a, i) {
this.group.removeAll();
var o = this._axisGroup;
if (this._axisGroup = new at(), this.group.add(this._axisGroup), !!t.get("show")) {
var s = t.getCoordSysModel(), l = ng(s, t), u = new Oe(t, B({
handleAutoShown: function(f) {
for (var c = s.coordinateSystem.getCartesians(), v = 0; v < c.length; v++)
if (qd(c[v].getOtherAxis(t.axis).scale))
return !0;
return !1;
}
}, l));
A(W3, u.add, u), this._axisGroup.add(u.getGroup()), A($3, function(f) {
t.get([f, "show"]) && U3[f](this, this._axisGroup, t, s);
}, this);
var h = i && i.type === "changeAxisOrder" && i.isInitSort;
h || Fl(o, this._axisGroup, t), r.prototype.render.call(this, t, n, a, i);
}
}, e.prototype.remove = function() {
jM(this);
}, e.type = "cartesianAxis", e;
}(Oi)
), U3 = {
splitLine: function(r, e, t, n) {
var a = t.axis;
if (!a.scale.isBlank()) {
var i = t.getModel("splitLine"), o = i.getModel("lineStyle"), s = o.get("color"), l = i.get("showMinLine") !== !1, u = i.get("showMaxLine") !== !1;
s = z(s) ? s : [s];
for (var h = n.coordinateSystem.getRect(), f = a.isHorizontal(), c = 0, v = a.getTicksCoords({
tickModel: i
}), p = [], d = [], g = o.getLineStyle(), y = 0; y < v.length; y++) {
var m = a.toGlobalCoord(v[y].coord);
if (!(y === 0 && !l || y === v.length - 1 && !u)) {
var _ = v[y].tickValue;
f ? (p[0] = m, p[1] = h.y, d[0] = m, d[1] = h.y + h.height) : (p[0] = h.x, p[1] = m, d[0] = h.x + h.width, d[1] = m);
var S = c++ % s.length, x = new he({
anid: _ != null ? "line_" + _ : null,
autoBatch: !0,
shape: {
x1: p[0],
y1: p[1],
x2: d[0],
y2: d[1]
},
style: et({
stroke: s[S]
}, g),
silent: !0
});
Do(x.shape, g.lineWidth), e.add(x);
}
}
}
},
minorSplitLine: function(r, e, t, n) {
var a = t.axis, i = t.getModel("minorSplitLine"), o = i.getModel("lineStyle"), s = n.coordinateSystem.getRect(), l = a.isHorizontal(), u = a.getMinorTicksCoords();
if (u.length)
for (var h = [], f = [], c = o.getLineStyle(), v = 0; v < u.length; v++)
for (var p = 0; p < u[v].length; p++) {
var d = a.toGlobalCoord(u[v][p].coord);
l ? (h[0] = d, h[1] = s.y, f[0] = d, f[1] = s.y + s.height) : (h[0] = s.x, h[1] = d, f[0] = s.x + s.width, f[1] = d);
var g = new he({
anid: "minor_line_" + u[v][p].tickValue,
autoBatch: !0,
shape: {
x1: h[0],
y1: h[1],
x2: f[0],
y2: f[1]
},
style: c,
silent: !0
});
Do(g.shape, c.lineWidth), e.add(g);
}
},
splitArea: function(r, e, t, n) {
KM(r, e, t, n);
}
}, JM = (
/** @class */
function(r) {
O(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t.type = e.type, t;
}
return e.type = "xAxis", e;
}(QM)
), Y3 = (
/** @class */
function(r) {
O(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t.type = JM.type, t;
}
return e.type = "yAxis", e;
}(QM)
), Z3 = (
/** @class */
function(r) {
O(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t.type = "grid", t;
}
return e.prototype.render = function(t, n) {
this.group.removeAll(), t.get("show") && this.group.add(new xt({
shape: t.coordinateSystem.getRect(),
style: et({
fill: t.get("backgroundColor")
}, t.getItemStyle()),
silent: !0,
z2: -1
}));
}, e.type = "grid", e;
}(Yt)
), HS = {
// gridIndex: 0,
// gridId: '',
offset: 0
};
function t2(r) {
r.registerComponentView(Z3), r.registerComponentModel(x3), r.registerCoordinateSystem("cartesian2d", I3), Eo(r, "x", eg, HS), Eo(r, "y", eg, HS), r.registerComponentView(JM), r.registerComponentView(Y3), r.registerPreprocessor(function(e) {
e.xAxis && e.yAxis && !e.grid && (e.grid = {});
});
}
function X3(r) {
gt(t2), r.registerSeriesModel(g3), r.registerChartView(S3), r.registerLayout(ql("scatter"));
}
function q3(r) {
r.eachSeriesByType("radar", function(e) {
var t = e.getData(), n = [], a = e.coordinateSystem;
if (a) {
var i = a.getIndicatorAxes();
A(i, function(o, s) {
t.each(t.mapDimension(i[s].dim), function(l, u) {
n[u] = n[u] || [];
var h = a.dataToPoint(l, s);
n[u][s] = WS(h) ? h : $S(a);
});
}), t.each(function(o) {
var s = AE(n[o], function(l) {
return WS(l);
}) || $S(a);
n[o].push(s.slice()), t.setItemLayout(o, n[o]);
});
}
});
}
function WS(r) {
return !isNaN(r[0]) && !isNaN(r[1]);
}
function $S(r) {
return [r.cx, r.cy];
}
function K3(r) {
var e = r.polar;
if (e) {
z(e) || (e = [e]);
var t = [];
A(e, function(n, a) {
n.indicator ? (n.type && !n.shape && (n.shape = n.type), r.radar = r.radar || [], z(r.radar) || (r.radar = [r.radar]), r.radar.push(n)) : t.push(n);
}), r.polar = t;
}
A(r.series, function(n) {
n && n.type === "radar" && n.polarIndex && (n.radarIndex = n.polarIndex);
});
}
var j3 = (
/** @class */
function(r) {
O(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t.type = e.type, t;
}
return e.prototype.render = function(t, n, a) {
var i = t.coordinateSystem, o = this.group, s = t.getData(), l = this._data;
function u(c, v) {
var p = c.getItemVisual(v, "symbol") || "circle";
if (p !== "none") {
var d = qo(c.getItemVisual(v, "symbolSize")), g = ae(p, -1, -1, 2, 2), y = c.getItemVisual(v, "symbolRotate") || 0;
return g.attr({
style: {
strokeNoScale: !0
},
z2: 100,
scaleX: d[0] / 2,
scaleY: d[1] / 2,
rotation: y * Math.PI / 180 || 0
}), g;
}
}
function h(c, v, p, d, g, y) {
p.removeAll();
for (var m = 0; m < v.length - 1; m++) {
var _ = u(d, g);
_ && (_.__dimIdx = m, c[m] ? (_.setPosition(c[m]), Pi[y ? "initProps" : "updateProps"](_, {
x: v[m][0],
y: v[m][1]
}, t, g)) : _.setPosition(v[m]), p.add(_));
}
}
function f(c) {
return G(c, function(v) {
return [i.cx, i.cy];
});
}
s.diff(l).add(function(c) {
var v = s.getItemLayout(c);
if (v) {
var p = new Fe(), d = new He(), g = {
shape: {
points: v
}
};
p.shape.points = f(v), d.shape.points = f(v), $t(p, g, t, c), $t(d, g, t, c);
var y = new at(), m = new at();
y.add(d), y.add(p), y.add(m), h(d.shape.points, v, m, s, c, !0), s.setItemGraphicEl(c, y);
}
}).update(function(c, v) {
var p = l.getItemGraphicEl(v), d = p.childAt(0), g = p.childAt(1), y = p.childAt(2), m = {
shape: {
points: s.getItemLayout(c)
}
};
m.shape.points && (h(d.shape.points, m.shape.points, y, s, c, !1), Or(g), Or(d), Ct(d, m, t), Ct(g, m, t), s.setItemGraphicEl(c, p));
}).remove(function(c) {
o.remove(l.getItemGraphicEl(c));
}).execute(), s.eachItemGraphicEl(function(c, v) {
var p = s.getItemModel(v), d = c.childAt(0), g = c.childAt(1), y = c.childAt(2), m = s.getItemVisual(v, "style"), _ = m.fill;
o.add(c), d.useStyle(et(p.getModel("lineStyle").getLineStyle(), {
fill: "none",
stroke: _
})), Se(d, p, "lineStyle"), Se(g, p, "areaStyle");
var S = p.getModel("areaStyle"), x = S.isEmpty() && S.parentModel.isEmpty();
g.ignore = x, A(["emphasis", "select", "blur"], function(T) {
var C = p.getModel([T, "areaStyle"]), D = C.isEmpty() && C.parentModel.isEmpty();
g.ensureState(T).ignore = D && x;
}), g.useStyle(et(S.getAreaStyle(), {
fill: _,
opacity: 0.7,
decal: m.decal
}));
var b = p.getModel("emphasis"), w = b.getModel("itemStyle").getItemStyle();
y.eachChild(function(T) {
if (T instanceof ge) {
var C = T.style;
T.useStyle(B({
// TODO other properties like x, y ?
image: C.image,
x: C.x,
y: C.y,
width: C.width,
height: C.height
}, m));
} else
T.useStyle(m), T.setColor(_), T.style.strokeNoScale = !0;
var D = T.ensureState("emphasis");
D.style = nt(w);
var M = s.getStore().get(s.getDimensionIndex(T.__dimIdx), v);
(M == null || isNaN(M)) && (M = ""), xe(T, ve(p), {
labelFetcher: s.hostModel,
labelDataIndex: v,
labelDimIndex: T.__dimIdx,
defaultText: M,
inheritColor: _,
defaultOpacity: m.opacity
});
}), Xt(c, b.get("focus"), b.get("blurScope"), b.get("disabled"));
}), this._data = s;
}, e.prototype.remove = function() {
this.group.removeAll(), this._data = null;
}, e.type = "radar", e;
}(kt)
), Q3 = (
/** @class */
function(r) {
O(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t.type = e.type, t.hasSymbolVisual = !0, t;
}
return e.prototype.init = function(t) {
r.prototype.init.apply(this, arguments), this.legendVisualProvider = new jl(Y(this.getData, this), Y(this.getRawData, this));
}, e.prototype.getInitialData = function(t, n) {
return jo(this, {
generateCoord: "indicator_",
generateCoordCount: 1 / 0
});
}, e.prototype.formatTooltip = function(t, n, a) {
var i = this.getData(), o = this.coordinateSystem, s = o.getIndicatorAxes(), l = this.getData().getName(t), u = l === "" ? this.name : l, h = JD(this, t);
return pe("section", {
header: u,
sortBlocks: !0,
blocks: G(s, function(f) {
var c = i.get(i.mapDimension(f.dim), t);
return pe("nameValue", {
markerType: "subItem",
markerColor: h,
name: f.name,
value: c,
sortParam: c
});
})
});
}, e.prototype.getTooltipPosition = function(t) {
if (t != null) {
for (var n = this.getData(), a = this.coordinateSystem, i = n.getValues(G(a.dimensions, function(u) {
return n.mapDimension(u);
}), t), o = 0, s = i.length; o < s; o++)
if (!isNaN(i[o])) {
var l = a.getIndicatorAxes();
return a.coordToPoint(l[o].dataToCoord(i[o]), o);
}
}
}, e.type = "series.radar", e.dependencies = ["radar"], e.defaultOption = {
// zlevel: 0,
z: 2,
colorBy: "data",
coordinateSystem: "radar",
legendHoverLink: !0,
radarIndex: 0,
lineStyle: {
width: 2,
type: "solid",
join: "round"
},
label: {
position: "top"
},
// areaStyle: {
// },
// itemStyle: {}
symbolSize: 8
// symbolRotate: null
}, e;
}(Ft)
), Ss = ZM.value;
function Gu(r, e) {
return et({
show: e
}, r);
}
var J3 = (
/** @class */
function(r) {
O(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t.type = e.type, t;
}
return e.prototype.optionUpdated = function() {
var t = this.get("boundaryGap"), n = this.get("splitNumber"), a = this.get("scale"), i = this.get("axisLine"), o = this.get("axisTick"), s = this.get("axisLabel"), l = this.get("axisName"), u = this.get(["axisName", "show"]), h = this.get(["axisName", "formatter"]), f = this.get("axisNameGap"), c = this.get("triggerEvent"), v = G(this.get("indicator") || [], function(p) {
p.max != null && p.max > 0 && !p.min ? p.min = 0 : p.min != null && p.min < 0 && !p.max && (p.max = 0);
var d = l;
p.color != null && (d = et({
color: p.color
}, l));
var g = ht(nt(p), {
boundaryGap: t,
splitNumber: n,
scale: a,
axisLine: i,
axisTick: o,
// axisType: axisType,
axisLabel: s,
// Compatible with 2 and use text
name: p.text,
showName: u,
nameLocation: "end",
nameGap: f,
// min: 0,
nameTextStyle: d,
triggerEvent: c
}, !1);
if (U(h)) {
var y = g.name;
g.name = h.replace("{value}", y ?? "");
} else K(h) && (g.name = h(g.name, g));
var m = new It(g, null, this.ecModel);
return ie(m, Ul.prototype), m.mainType = "radar", m.componentIndex = this.componentIndex, m;
}, this);
this._indicatorModels = v;
}, e.prototype.getIndicatorModels = function() {
return this._indicatorModels;
}, e.type = "radar", e.defaultOption = {
// zlevel: 0,
z: 0,
center: ["50%", "50%"],
radius: "75%",
startAngle: 90,
axisName: {
show: !0
// formatter: null
// textStyle: {}
},
boundaryGap: [0, 0],
splitNumber: 5,
axisNameGap: 15,
scale: !1,
// Polygon or circle
shape: "polygon",
axisLine: ht({
lineStyle: {
color: "#bbb"
}
}, Ss.axisLine),
axisLabel: Gu(Ss.axisLabel, !1),
axisTick: Gu(Ss.axisTick, !1),
// axisType: 'value',
splitLine: Gu(Ss.splitLine, !0),
splitArea: Gu(Ss.splitArea, !0),
// {text, min, max}
indicator: []
}, e;
}(_t)
), tG = ["axisLine", "axisTickLabel", "axisName"], eG = (
/** @class */
function(r) {
O(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t.type = e.type, t;
}
return e.prototype.render = function(t, n, a) {
var i = this.group;
i.removeAll(), this._buildAxes(t), this._buildSplitLineAndArea(t);
}, e.prototype._buildAxes = function(t) {
var n = t.coordinateSystem, a = n.getIndicatorAxes(), i = G(a, function(o) {
var s = o.model.get("showName") ? o.name : "", l = new Oe(o.model, {
axisName: s,
position: [n.cx, n.cy],
rotation: o.angle,
labelDirection: -1,
tickDirection: -1,
nameDirection: 1
});
return l;
});
A(i, function(o) {
A(tG, o.add, o), this.group.add(o.getGroup());
}, this);
}, e.prototype._buildSplitLineAndArea = function(t) {
var n = t.coordinateSystem, a = n.getIndicatorAxes();
if (!a.length)
return;
var i = t.get("shape"), o = t.getModel("splitLine"), s = t.getModel("splitArea"), l = o.getModel("lineStyle"), u = s.getModel("areaStyle"), h = o.get("show"), f = s.get("show"), c = l.get("color"), v = u.get("color"), p = z(c) ? c : [c], d = z(v) ? v : [v], g = [], y = [];
function m(P, k, N) {
var R = N % k.length;
return P[R] = P[R] || [], R;
}
if (i === "circle")
for (var _ = a[0].getTicksCoords(), S = n.cx, x = n.cy, b = 0; b < _.length; b++) {
if (h) {
var w = m(g, p, b);
g[w].push(new Nn({
shape: {
cx: S,
cy: x,
r: _[b].coord
}
}));
}
if (f && b < _.length - 1) {
var w = m(y, d, b);
y[w].push(new Bl({
shape: {
cx: S,
cy: x,
r0: _[b].coord,
r: _[b + 1].coord
}
}));
}
}
else
for (var T, C = G(a, function(P, k) {
var N = P.getTicksCoords();
return T = T == null ? N.length - 1 : Math.min(N.length - 1, T), G(N, function(R) {
return n.coordToPoint(R.coord, k);
});
}), D = [], b = 0; b <= T; b++) {
for (var M = [], I = 0; I < a.length; I++)
M.push(C[I][b]);
if (M[0] ? M.push(M[0].slice()) : process.env.NODE_ENV !== "production" && console.error("Can't draw value axis " + b), h) {
var w = m(g, p, b);
g[w].push(new He({
shape: {
points: M
}
}));
}
if (f && D) {
var w = m(y, d, b - 1);
y[w].push(new Fe({
shape: {
points: M.concat(D)
}
}));
}
D = M.slice().reverse();
}
var L = l.getLineStyle(), E = u.getAreaStyle();
A(y, function(P, k) {
this.group.add(dr(P, {
style: et({
stroke: "none",
fill: d[k % d.length]
}, E),
silent: !0
}));
}, this), A(g, function(P, k) {
this.group.add(dr(P, {
style: et({
fill: "none",
stroke: p[k % p.length]
}, L),
silent: !0
}));
}, this);
}, e.type = "radar", e;
}(Yt)
), rG = (
/** @class */
function(r) {
O(e, r);
function e(t, n, a) {
var i = r.call(this, t, n, a) || this;
return i.type = "value", i.angle = 0, i.name = "", i;
}
return e;
}(Br)
), nG = (
/** @class */
function() {
function r(e, t, n) {
this.dimensions = [], this._model = e, this._indicatorAxes = G(e.getIndicatorModels(), function(a, i) {
var o = "indicator_" + i, s = new rG(
o,
new En()
// (indicatorModel.get('axisType') === 'log') ? new LogScale() : new IntervalScale()
);
return s.name = a.get("name"), s.model = a, a.axis = s, this.dimensions.push(o), s;
}, this), this.resize(e, n);
}
return r.prototype.getIndicatorAxes = function() {
return this._indicatorAxes;
}, r.prototype.dataToPoint = function(e, t) {
var n = this._indicatorAxes[t];
return this.coordToPoint(n.dataToCoord(e), t);
}, r.prototype.coordToPoint = function(e, t) {
var n = this._indicatorAxes[t], a = n.angle, i = this.cx + e * Math.cos(a), o = this.cy - e * Math.sin(a);
return [i, o];
}, r.prototype.pointToData = function(e) {
var t = e[0] - this.cx, n = e[1] - this.cy, a = Math.sqrt(t * t + n * n);
t /= a, n /= a;
for (var i = Math.atan2(-n, t), o = 1 / 0, s, l = -1, u = 0; u < this._indicatorAxes.length; u++) {
var h = this._indicatorAxes[u], f = Math.abs(i - h.angle);
f < o && (s = h, l = u, o = f);
}
return [l, +(s && s.coordToData(a))];
}, r.prototype.resize = function(e, t) {
var n = e.get("center"), a = t.getWidth(), i = t.getHeight(), o = Math.min(a, i) / 2;
this.cx = W(n[0], a), this.cy = W(n[1], i), this.startAngle = e.get("startAngle") * Math.PI / 180;
var s = e.get("radius");
(U(s) || Tt(s)) && (s = [0, s]), this.r0 = W(s[0], o), this.r = W(s[1], o), A(this._indicatorAxes, function(l, u) {
l.setExtent(this.r0, this.r);
var h = this.startAngle + u * Math.PI * 2 / this._indicatorAxes.length;
h = Math.atan2(Math.sin(h), Math.cos(h)), l.angle = h;
}, this);
}, r.prototype.update = function(e, t) {
var n = this._indicatorAxes, a = this._model;
A(n, function(s) {
s.scale.setExtent(1 / 0, -1 / 0);
}), e.eachSeriesByType("radar", function(s, l) {
if (!(s.get("coordinateSystem") !== "radar" || e.getComponent("radar", s.get("radarIndex")) !== a)) {
var u = s.getData();
A(n, function(h) {
h.scale.unionExtentFromData(u, u.mapDimension(h.dim));
});
}
}, this);
var i = a.get("splitNumber"), o = new En();
o.setExtent(0, i), o.setInterval(1), A(n, function(s, l) {
XM(s.scale, s.model, o);
});
}, r.prototype.convertToPixel = function(e, t, n) {
return console.warn("Not implemented."), null;
}, r.prototype.convertFromPixel = function(e, t, n) {
return console.warn("Not implemented."), null;
}, r.prototype.containPoint = function(e) {
return console.warn("Not implemented."), !1;
}, r.create = function(e, t) {
var n = [];
return e.eachComponent("radar", function(a) {
var i = new r(a, e, t);
n.push(i), a.coordinateSystem = i;
}), e.eachSeriesByType("radar", function(a) {
a.get("coordinateSystem") === "radar" && (a.coordinateSystem = n[a.get("radarIndex") || 0]);
}), n;
}, r.dimensions = [], r;
}()
);
function aG(r) {
r.registerCoordinateSystem("radar", nG), r.registerComponentModel(J3), r.registerComponentView(eG), r.registerVisual({
seriesType: "radar",
reset: function(e) {
var t = e.getData();
t.each(function(n) {
t.setItemVisual(n, "legendIcon", "roundRect");
}), t.setVisual("legendIcon", "roundRect");
}
});
}
function iG(r) {
gt(aG), r.registerChartView(j3), r.registerSeriesModel(Q3), r.registerLayout(q3), r.registerProcessor(Kl("radar")), r.registerPreprocessor(K3);
}
var US = "\0_ec_interaction_mutex";
function oG(r, e, t) {
var n = om(r);
n[e] = t;
}
function sG(r, e, t) {
var n = om(r), a = n[e];
a === t && (n[e] = null);
}
function YS(r, e) {
return !!om(r)[e];
}
function om(r) {
return r[US] || (r[US] = {});
}
un({
type: "takeGlobalCursor",
event: "globalCursorTaken",
update: "update"
}, Jt);
var Ql = (
/** @class */
function(r) {
O(e, r);
function e(t) {
var n = r.call(this) || this;
n._zr = t;
var a = Y(n._mousedownHandler, n), i = Y(n._mousemoveHandler, n), o = Y(n._mouseupHandler, n), s = Y(n._mousewheelHandler, n), l = Y(n._pinchHandler, n);
return n.enable = function(u, h) {
this.disable(), this._opt = et(nt(h) || {}, {
zoomOnMouseWheel: !0,
moveOnMouseMove: !0,
// By default, wheel do not trigger move.
moveOnMouseWheel: !1,
preventDefaultMouseMove: !0
}), u == null && (u = !0), (u === !0 || u === "move" || u === "pan") && (t.on("mousedown", a), t.on("mousemove", i), t.on("mouseup", o)), (u === !0 || u === "scale" || u === "zoom") && (t.on("mousewheel", s), t.on("pinch", l));
}, n.disable = function() {
t.off("mousedown", a), t.off("mousemove", i), t.off("mouseup", o), t.off("mousewheel", s), t.off("pinch", l);
}, n;
}
return e.prototype.isDragging = function() {
return this._dragging;
}, e.prototype.isPinching = function() {
return this._pinching;
}, e.prototype.setPointerChecker = function(t) {
this.pointerChecker = t;
}, e.prototype.dispose = function() {
this.disable();
}, e.prototype._mousedownHandler = function(t) {
if (!_0(t)) {
for (var n = t.target; n; ) {
if (n.draggable)
return;
n = n.__hostTarget || n.parent;
}
var a = t.offsetX, i = t.offsetY;
this.pointerChecker && this.pointerChecker(t, a, i) && (this._x = a, this._y = i, this._dragging = !0);
}
}, e.prototype._mousemoveHandler = function(t) {
if (!(!this._dragging || !_h("moveOnMouseMove", t, this._opt) || t.gestureEvent === "pinch" || YS(this._zr, "globalPan"))) {
var n = t.offsetX, a = t.offsetY, i = this._x, o = this._y, s = n - i, l = a - o;
this._x = n, this._y = a, this._opt.preventDefaultMouseMove && Dn(t.event), e2(this, "pan", "moveOnMouseMove", t, {
dx: s,
dy: l,
oldX: i,
oldY: o,
newX: n,
newY: a,
isAvailableBehavior: null
});
}
}, e.prototype._mouseupHandler = function(t) {
_0(t) || (this._dragging = !1);
}, e.prototype._mousewheelHandler = function(t) {
var n = _h("zoomOnMouseWheel", t, this._opt), a = _h("moveOnMouseWheel", t, this._opt), i = t.wheelDelta, o = Math.abs(i), s = t.offsetX, l = t.offsetY;
if (!(i === 0 || !n && !a)) {
if (n) {
var u = o > 3 ? 1.4 : o > 1 ? 1.2 : 1.1, h = i > 0 ? u : 1 / u;
Uv(this, "zoom", "zoomOnMouseWheel", t, {
scale: h,
originX: s,
originY: l,
isAvailableBehavior: null
});
}
if (a) {
var f = Math.abs(i), c = (i > 0 ? 1 : -1) * (f > 3 ? 0.4 : f > 1 ? 0.15 : 0.05);
Uv(this, "scrollMove", "moveOnMouseWheel", t, {
scrollDelta: c,
originX: s,
originY: l,
isAvailableBehavior: null
});
}
}
}, e.prototype._pinchHandler = function(t) {
if (!YS(this._zr, "globalPan")) {
var n = t.pinchScale > 1 ? 1.1 : 1 / 1.1;
Uv(this, "zoom", null, t, {
scale: n,
originX: t.pinchX,
originY: t.pinchY,
isAvailableBehavior: null
});
}
}, e;
}(xr)
);
function Uv(r, e, t, n, a) {
r.pointerChecker && r.pointerChecker(n, a.originX, a.originY) && (Dn(n.event), e2(r, e, t, n, a));
}
function e2(r, e, t, n, a) {
a.isAvailableBehavior = Y(_h, null, t, n), r.trigger(e, a);
}
function _h(r, e, t) {
var n = t[r];
return !r || n && (!U(n) || e.event[n + "Key"]);
}
function sm(r, e, t) {
var n = r.target;
n.x += e, n.y += t, n.dirty();
}
function lm(r, e, t, n) {
var a = r.target, i = r.zoomLimit, o = r.zoom = r.zoom || 1;
if (o *= e, i) {
var s = i.min || 0, l = i.max || 1 / 0;
o = Math.max(Math.min(l, o), s);
}
var u = o / r.zoom;
r.zoom = o, a.x -= (t - a.x) * (u - 1), a.y -= (n - a.y) * (u - 1), a.scaleX *= u, a.scaleY *= u, a.dirty();
}
var lG = {
axisPointer: 1,
tooltip: 1,
brush: 1
};
function cc(r, e, t) {
var n = e.getComponentByElement(r.topTarget), a = n && n.coordinateSystem;
return n && n !== t && !lG.hasOwnProperty(n.mainType) && a && a.model !== t;
}
function r2(r) {
if (U(r)) {
var e = new DOMParser();
r = e.parseFromString(r, "text/xml");
}
var t = r;
for (t.nodeType === 9 && (t = t.firstChild); t.nodeName.toLowerCase() !== "svg" || t.nodeType !== 1; )
t = t.nextSibling;
return t;
}
var Yv, sf = {
fill: "fill",
stroke: "stroke",
"stroke-width": "lineWidth",
opacity: "opacity",
"fill-opacity": "fillOpacity",
"stroke-opacity": "strokeOpacity",
"stroke-dasharray": "lineDash",
"stroke-dashoffset": "lineDashOffset",
"stroke-linecap": "lineCap",
"stroke-linejoin": "lineJoin",
"stroke-miterlimit": "miterLimit",
"font-family": "fontFamily",
"font-size": "fontSize",
"font-style": "fontStyle",
"font-weight": "fontWeight",
"text-anchor": "textAlign",
visibility: "visibility",
display: "display"
}, ZS = St(sf), lf = {
"alignment-baseline": "textBaseline",
"stop-color": "stopColor"
}, XS = St(lf), uG = function() {
function r() {
this._defs = {}, this._root = null;
}
return r.prototype.parse = function(e, t) {
t = t || {};
var n = r2(e);
if (process.env.NODE_ENV !== "production" && !n)
throw new Error("Illegal svg");
this._defsUsePending = [];
var a = new at();
this._root = a;
var i = [], o = n.getAttribute("viewBox") || "", s = parseFloat(n.getAttribute("width") || t.width), l = parseFloat(n.getAttribute("height") || t.height);
isNaN(s) && (s = null), isNaN(l) && (l = null), je(n, a, null, !0, !1);
for (var u = n.firstChild; u; )
this._parseNode(u, a, i, null, !1, !1), u = u.nextSibling;
cG(this._defs, this._defsUsePending), this._defsUsePending = [];
var h, f;
if (o) {
var c = vc(o);
c.length >= 4 && (h = {
x: parseFloat(c[0] || 0),
y: parseFloat(c[1] || 0),
width: parseFloat(c[2]),
height: parseFloat(c[3])
});
}
if (h && s != null && l != null && (f = a2(h, { x: 0, y: 0, width: s, height: l }), !t.ignoreViewBox)) {
var v = a;
a = new at(), a.add(v), v.scaleX = v.scaleY = f.scale, v.x = f.x, v.y = f.y;
}
return !t.ignoreRootClip && s != null && l != null && a.setClipPath(new xt({
shape: { x: 0, y: 0, width: s, height: l }
})), {
root: a,
width: s,
height: l,
viewBoxRect: h,
viewBoxTransform: f,
named: i
};
}, r.prototype._parseNode = function(e, t, n, a, i, o) {
var s = e.nodeName.toLowerCase(), l, u = a;
if (s === "defs" && (i = !0), s === "text" && (o = !0), s === "defs" || s === "switch")
l = t;
else {
if (!i) {
var h = Yv[s];
if (h && Z(Yv, s)) {
l = h.call(this, e, t);
var f = e.getAttribute("name");
if (f) {
var c = {
name: f,
namedFrom: null,
svgNodeTagLower: s,
el: l
};
n.push(c), s === "g" && (u = c);
} else a && n.push({
name: a.name,
namedFrom: a,
svgNodeTagLower: s,
el: l
});
t.add(l);
}
}
var v = qS[s];
if (v && Z(qS, s)) {
var p = v.call(this, e), d = e.getAttribute("id");
d && (this._defs[d] = p);
}
}
if (l && l.isGroup)
for (var g = e.firstChild; g; )
g.nodeType === 1 ? this._parseNode(g, l, n, u, i, o) : g.nodeType === 3 && o && this._parseText(g, l), g = g.nextSibling;
}, r.prototype._parseText = function(e, t) {
var n = new Co({
style: {
text: e.textContent
},
silent: !0,
x: this._textX || 0,
y: this._textY || 0
});
or(t, n), je(e, n, this._defsUsePending, !1, !1), hG(n, t);
var a = n.style, i = a.fontSize;
i && i < 9 && (a.fontSize = 9, n.scaleX *= i / 9, n.scaleY *= i / 9);
var o = (a.fontSize || a.fontFamily) && [
a.fontStyle,
a.fontWeight,
(a.fontSize || 12) + "px",
a.fontFamily || "sans-serif"
].join(" ");
a.font = o;
var s = n.getBoundingRect();
return this._textX += s.width, t.add(n), n;
}, r.internalField = function() {
Yv = {
g: function(e, t) {
var n = new at();
return or(t, n), je(e, n, this._defsUsePending, !1, !1), n;
},
rect: function(e, t) {
var n = new xt();
return or(t, n), je(e, n, this._defsUsePending, !1, !1), n.setShape({
x: parseFloat(e.getAttribute("x") || "0"),
y: parseFloat(e.getAttribute("y") || "0"),
width: parseFloat(e.getAttribute("width") || "0"),
height: parseFloat(e.getAttribute("height") || "0")
}), n.silent = !0, n;
},
circle: function(e, t) {
var n = new Nn();
return or(t, n), je(e, n, this._defsUsePending, !1, !1), n.setShape({
cx: parseFloat(e.getAttribute("cx") || "0"),
cy: parseFloat(e.getAttribute("cy") || "0"),
r: parseFloat(e.getAttribute("r") || "0")
}), n.silent = !0, n;
},
line: function(e, t) {
var n = new he();
return or(t, n), je(e, n, this._defsUsePending, !1, !1), n.setShape({
x1: parseFloat(e.getAttribute("x1") || "0"),
y1: parseFloat(e.getAttribute("y1") || "0"),
x2: parseFloat(e.getAttribute("x2") || "0"),
y2: parseFloat(e.getAttribute("y2") || "0")
}), n.silent = !0, n;
},
ellipse: function(e, t) {
var n = new Uf();
return or(t, n), je(e, n, this._defsUsePending, !1, !1), n.setShape({
cx: parseFloat(e.getAttribute("cx") || "0"),
cy: parseFloat(e.getAttribute("cy") || "0"),
rx: parseFloat(e.getAttribute("rx") || "0"),
ry: parseFloat(e.getAttribute("ry") || "0")
}), n.silent = !0, n;
},
polygon: function(e, t) {
var n = e.getAttribute("points"), a;
n && (a = QS(n));
var i = new Fe({
shape: {
points: a || []
},
silent: !0
});
return or(t, i), je(e, i, this._defsUsePending, !1, !1), i;
},
polyline: function(e, t) {
var n = e.getAttribute("points"), a;
n && (a = QS(n));
var i = new He({
shape: {
points: a || []
},
silent: !0
});
return or(t, i), je(e, i, this._defsUsePending, !1, !1), i;
},
image: function(e, t) {
var n = new ge();
return or(t, n), je(e, n, this._defsUsePending, !1, !1), n.setStyle({
image: e.getAttribute("xlink:href") || e.getAttribute("href"),
x: +e.getAttribute("x"),
y: +e.getAttribute("y"),
width: +e.getAttribute("width"),
height: +e.getAttribute("height")
}), n.silent = !0, n;
},
text: function(e, t) {
var n = e.getAttribute("x") || "0", a = e.getAttribute("y") || "0", i = e.getAttribute("dx") || "0", o = e.getAttribute("dy") || "0";
this._textX = parseFloat(n) + parseFloat(i), this._textY = parseFloat(a) + parseFloat(o);
var s = new at();
return or(t, s), je(e, s, this._defsUsePending, !1, !0), s;
},
tspan: function(e, t) {
var n = e.getAttribute("x"), a = e.getAttribute("y");
n != null && (this._textX = parseFloat(n)), a != null && (this._textY = parseFloat(a));
var i = e.getAttribute("dx") || "0", o = e.getAttribute("dy") || "0", s = new at();
return or(t, s), je(e, s, this._defsUsePending, !1, !0), this._textX += parseFloat(i), this._textY += parseFloat(o), s;
},
path: function(e, t) {
var n = e.getAttribute("d") || "", a = XC(n);
return or(t, a), je(e, a, this._defsUsePending, !1, !1), a.silent = !0, a;
}
};
}(), r;
}(), qS = {
lineargradient: function(r) {
var e = parseInt(r.getAttribute("x1") || "0", 10), t = parseInt(r.getAttribute("y1") || "0", 10), n = parseInt(r.getAttribute("x2") || "10", 10), a = parseInt(r.getAttribute("y2") || "0", 10), i = new Gl(e, t, n, a);
return KS(r, i), jS(r, i), i;
},
radialgradient: function(r) {
var e = parseInt(r.getAttribute("cx") || "0", 10), t = parseInt(r.getAttribute("cy") || "0", 10), n = parseInt(r.getAttribute("r") || "0", 10), a = new QC(e, t, n);
return KS(r, a), jS(r, a), a;
}
};
function KS(r, e) {
var t = r.getAttribute("gradientUnits");
t === "userSpaceOnUse" && (e.global = !0);
}
function jS(r, e) {
for (var t = r.firstChild; t; ) {
if (t.nodeType === 1 && t.nodeName.toLocaleLowerCase() === "stop") {
var n = t.getAttribute("offset"), a = void 0;
n && n.indexOf("%") > 0 ? a = parseInt(n, 10) / 100 : n ? a = parseFloat(n) : a = 0;
var i = {};
n2(t, i, i);
var o = i.stopColor || t.getAttribute("stop-color") || "#000000";
e.colorStops.push({
offset: a,
color: o
});
}
t = t.nextSibling;
}
}
function or(r, e) {
r && r.__inheritedStyle && (e.__inheritedStyle || (e.__inheritedStyle = {}), et(e.__inheritedStyle, r.__inheritedStyle));
}
function QS(r) {
for (var e = vc(r), t = [], n = 0; n < e.length; n += 2) {
var a = parseFloat(e[n]), i = parseFloat(e[n + 1]);
t.push([a, i]);
}
return t;
}
function je(r, e, t, n, a) {
var i = e, o = i.__inheritedStyle = i.__inheritedStyle || {}, s = {};
r.nodeType === 1 && (dG(r, e), n2(r, o, s), n || gG(r, o, s)), i.style = i.style || {}, o.fill != null && (i.style.fill = JS(i, "fill", o.fill, t)), o.stroke != null && (i.style.stroke = JS(i, "stroke", o.stroke, t)), A([
"lineWidth",
"opacity",
"fillOpacity",
"strokeOpacity",
"miterLimit",
"fontSize"
], function(l) {
o[l] != null && (i.style[l] = parseFloat(o[l]));
}), A([
"lineDashOffset",
"lineCap",
"lineJoin",
"fontWeight",
"fontFamily",
"fontStyle",
"textAlign"
], function(l) {
o[l] != null && (i.style[l] = o[l]);
}), a && (i.__selfStyle = s), o.lineDash && (i.style.lineDash = G(vc(o.lineDash), function(l) {
return parseFloat(l);
})), (o.visibility === "hidden" || o.visibility === "collapse") && (i.invisible = !0), o.display === "none" && (i.ignore = !0);
}
function hG(r, e) {
var t = e.__selfStyle;
if (t) {
var n = t.textBaseline, a = n;
!n || n === "auto" || n === "baseline" ? a = "alphabetic" : n === "before-edge" || n === "text-before-edge" ? a = "top" : n === "after-edge" || n === "text-after-edge" ? a = "bottom" : (n === "central" || n === "mathematical") && (a = "middle"), r.style.textBaseline = a;
}
var i = e.__inheritedStyle;
if (i) {
var o = i.textAlign, s = o;
o && (o === "middle" && (s = "center"), r.style.textAlign = s);
}
}
var fG = /^url\(\s*#(.*?)\)/;
function JS(r, e, t, n) {
var a = t && t.match(fG);
if (a) {
var i = Ir(a[1]);
n.push([r, e, i]);
return;
}
return t === "none" && (t = null), t;
}
function cG(r, e) {
for (var t = 0; t < e.length; t++) {
var n = e[t];
n[0].style[n[1]] = r[n[2]];
}
}
var vG = /-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;
function vc(r) {
return r.match(vG) || [];
}
var pG = /(translate|scale|rotate|skewX|skewY|matrix)\(([\-\s0-9\.eE,]*)\)/g, Zv = Math.PI / 180;
function dG(r, e) {
var t = r.getAttribute("transform");
if (t) {
t = t.replace(/,/g, " ");
var n = [], a = null;
t.replace(pG, function(f, c, v) {
return n.push(c, v), "";
});
for (var i = n.length - 1; i > 0; i -= 2) {
var o = n[i], s = n[i - 1], l = vc(o);
switch (a = a || tr(), s) {
case "translate":
nn(a, a, [parseFloat(l[0]), parseFloat(l[1] || "0")]);
break;
case "scale":
ny(a, a, [parseFloat(l[0]), parseFloat(l[1] || l[0])]);
break;
case "rotate":
Li(a, a, -parseFloat(l[0]) * Zv, [
parseFloat(l[1] || "0"),
parseFloat(l[2] || "0")
]);
break;
case "skewX":
var u = Math.tan(parseFloat(l[0]) * Zv);
xn(a, [1, 0, u, 1, 0, 0], a);
break;
case "skewY":
var h = Math.tan(parseFloat(l[0]) * Zv);
xn(a, [1, h, 0, 1, 0, 0], a);
break;
case "matrix":
a[0] = parseFloat(l[0]), a[1] = parseFloat(l[1]), a[2] = parseFloat(l[2]), a[3] = parseFloat(l[3]), a[4] = parseFloat(l[4]), a[5] = parseFloat(l[5]);
break;
}
}
e.setLocalTransform(a);
}
}
var tx = /([^\s:;]+)\s*:\s*([^:;]+)/g;
function n2(r, e, t) {
var n = r.getAttribute("style");
if (n) {
tx.lastIndex = 0;
for (var a; (a = tx.exec(n)) != null; ) {
var i = a[1], o = Z(sf, i) ? sf[i] : null;
o && (e[o] = a[2]);
var s = Z(lf, i) ? lf[i] : null;
s && (t[s] = a[2]);
}
}
}
function gG(r, e, t) {
for (var n = 0; n < ZS.length; n++) {
var a = ZS[n], i = r.getAttribute(a);
i != null && (e[sf[a]] = i);
}
for (var n = 0; n < XS.length; n++) {
var a = XS[n], i = r.getAttribute(a);
i != null && (t[lf[a]] = i);
}
}
function a2(r, e) {
var t = e.width / r.width, n = e.height / r.height, a = Math.min(t, n);
return {
scale: a,
x: -(r.x + r.width / 2) * a + (e.x + e.width / 2),
y: -(r.y + r.height / 2) * a + (e.y + e.height / 2)
};
}
function yG(r, e) {
var t = new uG();
return t.parse(r, e);
}
var mG = X([
"rect",
"circle",
"line",
"ellipse",
"polygon",
"polyline",
"path",
// <text> <tspan> are also enabled because some SVG might paint text itself,
// but still need to trigger events or tooltip.
"text",
"tspan",
// <g> is also enabled because this case: if multiple tags share one name
// and need label displayed, every tags will display the name, which is not
// expected. So we can put them into a <g name="xxx">. Thereby only one label
// displayed and located based on the bounding rect of the <g>.
"g"
]), _G = (
/** @class */
function() {
function r(e, t) {
this.type = "geoSVG", this._usedGraphicMap = X(), this._freedGraphics = [], this._mapName = e, this._parsedXML = r2(t);
}
return r.prototype.load = function() {
var e = this._firstGraphic;
if (!e) {
e = this._firstGraphic = this._buildGraphic(this._parsedXML), this._freedGraphics.push(e), this._boundingRect = this._firstGraphic.boundingRect.clone();
var t = xG(e.named), n = t.regions, a = t.regionsMap;
this._regions = n, this._regionsMap = a;
}
return {
boundingRect: this._boundingRect,
regions: this._regions,
regionsMap: this._regionsMap
};
}, r.prototype._buildGraphic = function(e) {
var t, n;
try {
t = e && yG(e, {
ignoreViewBox: !0,
ignoreRootClip: !0
}) || {}, n = t.root, tt(n != null);
} catch (g) {
throw new Error(`Invalid svg format
` + g.message);
}
var a = new at();
a.add(n), a.isGeoSVGGraphicRoot = !0;
var i = t.width, o = t.height, s = t.viewBoxRect, l = this._boundingRect;
if (!l) {
var u = void 0, h = void 0, f = void 0, c = void 0;
if (i != null ? (u = 0, f = i) : s && (u = s.x, f = s.width), o != null ? (h = 0, c = o) : s && (h = s.y, c = s.height), u == null || h == null) {
var v = n.getBoundingRect();
u == null && (u = v.x, f = v.width), h == null && (h = v.y, c = v.height);
}
l = this._boundingRect = new ct(u, h, f, c);
}
if (s) {
var p = a2(s, l);
n.scaleX = n.scaleY = p.scale, n.x = p.x, n.y = p.y;
}
a.setClipPath(new xt({
shape: l.plain()
}));
var d = [];
return A(t.named, function(g) {
mG.get(g.svgNodeTagLower) != null && (d.push(g), SG(g.el));
}), {
root: a,
boundingRect: l,
named: d
};
}, r.prototype.useGraphic = function(e) {
var t = this._usedGraphicMap, n = t.get(e);
return n || (n = this._freedGraphics.pop() || this._buildGraphic(this._parsedXML), t.set(e, n), n);
}, r.prototype.freeGraphic = function(e) {
var t = this._usedGraphicMap, n = t.get(e);
n && (t.removeKey(e), this._freedGraphics.push(n));
}, r;
}()
);
function SG(r) {
r.silent = !1, r.isGroup && r.traverse(function(e) {
e.silent = !1;
});
}
function xG(r) {
var e = [], t = X();
return A(r, function(n) {
if (n.namedFrom == null) {
var a = new dz(n.name, n.el);
e.push(a), t.set(n.name, a);
}
}), {
regions: e,
regionsMap: t
};
}
var og = [126, 25], ex = "南海诸岛", Ya = [[[0, 3.5], [7, 11.2], [15, 11.9], [30, 7], [42, 0.7], [52, 0.7], [56, 7.7], [59, 0.7], [64, 0.7], [64, 0], [5, 0], [0, 3.5]], [[13, 16.1], [19, 14.7], [16, 21.7], [11, 23.1], [13, 16.1]], [[12, 32.2], [14, 38.5], [15, 38.5], [13, 32.2], [12, 32.2]], [[16, 47.6], [12, 53.2], [13, 53.2], [18, 47.6], [16, 47.6]], [[6, 64.4], [8, 70], [9, 70], [8, 64.4], [6, 64.4]], [[23, 82.6], [29, 79.8], [30, 79.8], [25, 82.6], [23, 82.6]], [[37, 70.7], [43, 62.3], [44, 62.3], [39, 70.7], [37, 70.7]], [[48, 51.1], [51, 45.5], [53, 45.5], [50, 51.1], [48, 51.1]], [[51, 35], [51, 28.7], [53, 28.7], [53, 35], [51, 35]], [[52, 22.4], [55, 17.5], [56, 17.5], [53, 22.4], [52, 22.4]], [[58, 12.6], [62, 7], [63, 7], [60, 12.6], [58, 12.6]], [[0, 3.5], [0, 93.1], [64, 93.1], [64, 0], [63, 0], [63, 92.4], [1, 92.4], [1, 3.5], [0, 3.5]]];
for (var $a = 0; $a < Ya.length; $a++)
for (var Qi = 0; Qi < Ya[$a].length; Qi++)
Ya[$a][Qi][0] /= 10.5, Ya[$a][Qi][1] /= -10.5 / 0.75, Ya[$a][Qi][0] += og[0], Ya[$a][Qi][1] += og[1];
function bG(r, e) {
if (r === "china") {
for (var t = 0; t < e.length; t++)
if (e[t].name === ex)
return;
e.push(new tM(ex, G(Ya, function(n) {
return {
type: "polygon",
exterior: n
};
}), og));
}
}
var wG = {
南海诸岛: [32, 80],
// 全国
广东: [0, -10],
香港: [10, 5],
澳门: [-10, 10],
// '北京': [-10, 0],
天津: [5, 5]
};
function TG(r, e) {
if (r === "china") {
var t = wG[e.name];
if (t) {
var n = e.getCenter();
n[0] += t[0] / 10.5, n[1] += -t[1] / (10.5 / 0.75), e.setCenter(n);
}
}
}
var CG = [[[123.45165252685547, 25.73527164402261], [123.49731445312499, 25.73527164402261], [123.49731445312499, 25.750734064600884], [123.45165252685547, 25.750734064600884], [123.45165252685547, 25.73527164402261]]];
function DG(r, e) {
r === "china" && e.name === "台湾" && e.geometries.push({
type: "polygon",
exterior: CG[0]
});
}
var AG = "name", MG = (
/** @class */
function() {
function r(e, t, n) {
this.type = "geoJSON", this._parsedMap = X(), this._mapName = e, this._specialAreas = n, this._geoJSON = LG(t);
}
return r.prototype.load = function(e, t) {
t = t || AG;
var n = this._parsedMap.get(t);
if (!n) {
var a = this._parseToRegions(t);
n = this._parsedMap.set(t, {
regions: a,
boundingRect: IG(a)
});
}
var i = X(), o = [];
return A(n.regions, function(s) {
var l = s.name;
e && Z(e, l) && (s = s.cloneShallow(l = e[l])), o.push(s), i.set(l, s);
}), {
regions: o,
boundingRect: n.boundingRect || new ct(0, 0, 0, 0),
regionsMap: i
};
}, r.prototype._parseToRegions = function(e) {
var t = this._mapName, n = this._geoJSON, a;
try {
a = n ? yz(n, e) : [];
} catch (i) {
throw new Error(`Invalid geoJson format
` + i.message);
}
return bG(t, a), A(a, function(i) {
var o = i.name;
TG(t, i), DG(t, i);
var s = this._specialAreas && this._specialAreas[o];
s && i.transformTo(s.left, s.top, s.width, s.height);
}, this), a;
}, r.prototype.getMapForUser = function() {
return {
// For backward compatibility, use geoJson
// PENDING: it has been returning them without clone.
// do we need to avoid outsite modification?
geoJson: this._geoJSON,
geoJSON: this._geoJSON,
specialAreas: this._specialAreas
};
}, r;
}()
);
function IG(r) {
for (var e, t = 0; t < r.length; t++) {
var n = r[t].getBoundingRect();
e = e || n.clone(), e.union(n);
}
return e;
}
function LG(r) {
return U(r) ? typeof JSON < "u" && JSON.parse ? JSON.parse(r) : new Function("return (" + r + ");")() : r;
}
var xs = X();
const Pn = {
/**
* Compatible with previous `echarts.registerMap`.
*
* @usage
* ```js
*
* echarts.registerMap('USA', geoJson, specialAreas);
*
* echarts.registerMap('USA', {
* geoJson: geoJson,
* specialAreas: {...}
* });
* echarts.registerMap('USA', {
* geoJSON: geoJson,
* specialAreas: {...}
* });
*
* echarts.registerMap('airport', {
* svg: svg
* }
* ```
*
* Note:
* Do not support that register multiple geoJSON or SVG
* one map name. Because different geoJSON and SVG have
* different unit. It's not easy to make sure how those
* units are mapping/normalize.
* If intending to use multiple geoJSON or SVG, we can
* use multiple geo coordinate system.
*/
registerMap: function(r, e, t) {
if (e.svg) {
var n = new _G(r, e.svg);
xs.set(r, n);
} else {
var a = e.geoJson || e.geoJSON;
a && !e.features ? t = e.specialAreas : a = e;
var n = new MG(r, a, t);
xs.set(r, n);
}
},
getGeoResource: function(r) {
return xs.get(r);
},
/**
* Only for exporting to users.
* **MUST NOT** used internally.
*/
getMapForUser: function(r) {
var e = xs.get(r);
return e && e.type === "geoJSON" && e.getMapForUser();
},
load: function(r, e, t) {
var n = xs.get(r);
if (!n) {
process.env.NODE_ENV !== "production" && console.error("Map " + r + " not exists. The GeoJSON of the map must be provided.");
return;
}
return n.load(e, t);
}
};
var um = ["rect", "circle", "line", "ellipse", "polygon", "polyline", "path"], EG = X(um), PG = X(um.concat(["g"])), kG = X(um.concat(["g"])), i2 = bt();
function Fu(r) {
var e = r.getItemStyle(), t = r.get("areaColor");
return t != null && (e.fill = t), e;
}
function rx(r) {
var e = r.style;
e && (e.stroke = e.stroke || e.fill, e.fill = null);
}
var o2 = (
/** @class */
function() {
function r(e) {
var t = new at();
this.uid = Ho("ec_map_draw"), this._controller = new Ql(e.getZr()), this._controllerHost = {
target: t
}, this.group = t, t.add(this._regionsGroup = new at()), t.add(this._svgGroup = new at());
}
return r.prototype.draw = function(e, t, n, a, i) {
var o = e.mainType === "geo", s = e.getData && e.getData();
o && t.eachComponent({
mainType: "series",
subType: "map"
}, function(y) {
!s && y.getHostGeoModel() === e && (s = y.getData());
});
var l = e.coordinateSystem, u = this._regionsGroup, h = this.group, f = l.getTransformInfo(), c = f.raw, v = f.roam, p = !u.childAt(0) || i;
p ? (h.x = v.x, h.y = v.y, h.scaleX = v.scaleX, h.scaleY = v.scaleY, h.dirty()) : Ct(h, v, e);
var d = s && s.getVisual("visualMeta") && s.getVisual("visualMeta").length > 0, g = {
api: n,
geo: l,
mapOrGeoModel: e,
data: s,
isVisualEncodedByVisualMap: d,
isGeo: o,
transformInfoRaw: c
};
l.resourceType === "geoJSON" ? this._buildGeoJSON(g) : l.resourceType === "geoSVG" && this._buildSVG(g), this._updateController(e, t, n), this._updateMapSelectHandler(e, u, n, a);
}, r.prototype._buildGeoJSON = function(e) {
var t = this._regionsGroupByName = X(), n = X(), a = this._regionsGroup, i = e.transformInfoRaw, o = e.mapOrGeoModel, s = e.data, l = e.geo.projection, u = l && l.stream;
function h(v, p) {
return p && (v = p(v)), v && [v[0] * i.scaleX + i.x, v[1] * i.scaleY + i.y];
}
function f(v) {
for (var p = [], d = !u && l && l.project, g = 0; g < v.length; ++g) {
var y = h(v[g], d);
y && p.push(y);
}
return p;
}
function c(v) {
return {
shape: {
points: f(v)
}
};
}
a.removeAll(), A(e.geo.regions, function(v) {
var p = v.name, d = t.get(p), g = n.get(p) || {}, y = g.dataIdx, m = g.regionModel;
if (!d) {
d = t.set(p, new at()), a.add(d), y = s ? s.indexOfName(p) : null, m = e.isGeo ? o.getRegionModel(p) : s ? s.getItemModel(y) : null;
var _ = m.get("silent", !0);
_ != null && (d.silent = _), n.set(p, {
dataIdx: y,
regionModel: m
});
}
var S = [], x = [];
A(v.geometries, function(T) {
if (T.type === "polygon") {
var C = [T.exterior].concat(T.interiors || []);
u && (C = lx(C, u)), A(C, function(M) {
S.push(new Fe(c(M)));
});
} else {
var D = T.points;
u && (D = lx(D, u, !0)), A(D, function(M) {
x.push(new He(c(M)));
});
}
});
var b = h(v.getCenter(), l && l.project);
function w(T, C) {
if (T.length) {
var D = new _y({
culling: !0,
segmentIgnoreThreshold: 1,
shape: {
paths: T
}
});
d.add(D), nx(e, D, y, m), ax(e, D, p, m, o, y, b), C && (rx(D), A(D.states, rx));
}
}
w(S), w(x, !0);
}), t.each(function(v, p) {
var d = n.get(p), g = d.dataIdx, y = d.regionModel;
ix(e, v, p, y, o, g), ox(e, v, p, y, o), sx(e, v, p, y, o);
}, this);
}, r.prototype._buildSVG = function(e) {
var t = e.geo.map, n = e.transformInfoRaw;
this._svgGroup.x = n.x, this._svgGroup.y = n.y, this._svgGroup.scaleX = n.scaleX, this._svgGroup.scaleY = n.scaleY, this._svgResourceChanged(t) && (this._freeSVG(), this._useSVG(t));
var a = this._svgDispatcherMap = X(), i = !1;
A(this._svgGraphicRecord.named, function(o) {
var s = o.name, l = e.mapOrGeoModel, u = e.data, h = o.svgNodeTagLower, f = o.el, c = u ? u.indexOfName(s) : null, v = l.getRegionModel(s);
EG.get(h) != null && f instanceof Sr && nx(e, f, c, v), f instanceof Sr && (f.culling = !0);
var p = v.get("silent", !0);
if (p != null && (f.silent = p), f.z2EmphasisLift = 0, !o.namedFrom && (kG.get(h) != null && ax(e, f, s, v, l, c, null), ix(e, f, s, v, l, c), ox(e, f, s, v, l), PG.get(h) != null)) {
var d = sx(e, f, s, v, l);
d === "self" && (i = !0);
var g = a.get(s) || a.set(s, []);
g.push(f);
}
}, this), this._enableBlurEntireSVG(i, e);
}, r.prototype._enableBlurEntireSVG = function(e, t) {
if (e && t.isGeo) {
var n = t.mapOrGeoModel.getModel(["blur", "itemStyle"]).getItemStyle(), a = n.opacity;
this._svgGraphicRecord.root.traverse(function(i) {
if (!i.isGroup) {
Ti(i);
var o = i.ensureState("blur").style || {};
o.opacity == null && a != null && (o.opacity = a), i.ensureState("emphasis");
}
});
}
}, r.prototype.remove = function() {
this._regionsGroup.removeAll(), this._regionsGroupByName = null, this._svgGroup.removeAll(), this._freeSVG(), this._controller.dispose(), this._controllerHost = null;
}, r.prototype.findHighDownDispatchers = function(e, t) {
if (e == null)
return [];
var n = t.coordinateSystem;
if (n.resourceType === "geoJSON") {
var a = this._regionsGroupByName;
if (a) {
var i = a.get(e);
return i ? [i] : [];
}
} else if (n.resourceType === "geoSVG")
return this._svgDispatcherMap && this._svgDispatcherMap.get(e) || [];
}, r.prototype._svgResourceChanged = function(e) {
return this._svgMapName !== e;
}, r.prototype._useSVG = function(e) {
var t = Pn.getGeoResource(e);
if (t && t.type === "geoSVG") {
var n = t.useGraphic(this.uid);
this._svgGroup.add(n.root), this._svgGraphicRecord = n, this._svgMapName = e;
}
}, r.prototype._freeSVG = function() {
var e = this._svgMapName;
if (e != null) {
var t = Pn.getGeoResource(e);
t && t.type === "geoSVG" && t.freeGraphic(this.uid), this._svgGraphicRecord = null, this._svgDispatcherMap = null, this._svgGroup.removeAll(), this._svgMapName = null;
}
}, r.prototype._updateController = function(e, t, n) {
var a = e.coordinateSystem, i = this._controller, o = this._controllerHost;
o.zoomLimit = e.get("scaleLimit"), o.zoom = a.getZoom(), i.enable(e.get("roam") || !1);
var s = e.mainType;
function l() {
var u = {
type: "geoRoam",
componentType: s
};
return u[s + "Id"] = e.id, u;
}
i.off("pan").on("pan", function(u) {
this._mouseDownFlag = !1, sm(o, u.dx, u.dy), n.dispatchAction(B(l(), {
dx: u.dx,
dy: u.dy,
animation: {
duration: 0
}
}));
}, this), i.off("zoom").on("zoom", function(u) {
this._mouseDownFlag = !1, lm(o, u.scale, u.originX, u.originY), n.dispatchAction(B(l(), {
totalZoom: o.zoom,
zoom: u.scale,
originX: u.originX,
originY: u.originY,
animation: {
duration: 0
}
}));
}, this), i.setPointerChecker(function(u, h, f) {
return a.containPoint([h, f]) && !cc(u, n, e);
});
}, r.prototype.resetForLabelLayout = function() {
this.group.traverse(function(e) {
var t = e.getTextContent();
t && (t.ignore = i2(t).ignore);
});
}, r.prototype._updateMapSelectHandler = function(e, t, n, a) {
var i = this;
t.off("mousedown"), t.off("click"), e.get("selectedMode") && (t.on("mousedown", function() {
i._mouseDownFlag = !0;
}), t.on("click", function(o) {
i._mouseDownFlag && (i._mouseDownFlag = !1);
}));
}, r;
}()
);
function nx(r, e, t, n) {
var a = n.getModel("itemStyle"), i = n.getModel(["emphasis", "itemStyle"]), o = n.getModel(["blur", "itemStyle"]), s = n.getModel(["select", "itemStyle"]), l = Fu(a), u = Fu(i), h = Fu(s), f = Fu(o), c = r.data;
if (c) {
var v = c.getItemVisual(t, "style"), p = c.getItemVisual(t, "decal");
r.isVisualEncodedByVisualMap && v.fill && (l.fill = v.fill), p && (l.decal = Mo(p, r.api));
}
e.setStyle(l), e.style.strokeNoScale = !0, e.ensureState("emphasis").style = u, e.ensureState("select").style = h, e.ensureState("blur").style = f, Ti(e);
}
function ax(r, e, t, n, a, i, o) {
var s = r.data, l = r.isGeo, u = s && isNaN(s.get(s.mapDimension("value"), i)), h = s && s.getItemLayout(i);
if (l || u || h && h.showLabel) {
var f = l ? t : i, c = void 0;
(!s || i >= 0) && (c = a);
var v = o ? {
normal: {
align: "center",
verticalAlign: "middle"
}
} : null;
xe(e, ve(n), {
labelFetcher: c,
labelDataIndex: f,
defaultText: t
}, v);
var p = e.getTextContent();
if (p && (i2(p).ignore = p.ignore, e.textConfig && o)) {
var d = e.getBoundingRect().clone();
e.textConfig.layoutRect = d, e.textConfig.position = [(o[0] - d.x) / d.width * 100 + "%", (o[1] - d.y) / d.height * 100 + "%"];
}
e.disableLabelAnimation = !0;
} else
e.removeTextContent(), e.removeTextConfig(), e.disableLabelAnimation = null;
}
function ix(r, e, t, n, a, i) {
r.data ? r.data.setItemGraphicEl(i, e) : it(e).eventData = {
componentType: "geo",
componentIndex: a.componentIndex,
geoIndex: a.componentIndex,
name: t,
region: n && n.option || {}
};
}
function ox(r, e, t, n, a) {
r.data || Ei({
el: e,
componentModel: a,
itemName: t,
// @ts-ignore FIXME:TS fix the "compatible with each other"?
itemTooltipOption: n.get("tooltip")
});
}
function sx(r, e, t, n, a) {
e.highDownSilentOnTouch = !!a.get("selectedMode");
var i = n.getModel("emphasis"), o = i.get("focus");
return Xt(e, o, i.get("blurScope"), i.get("disabled")), r.isGeo && AR(e, a, t), o;
}
function lx(r, e, t) {
var n = [], a;
function i() {
a = [];
}
function o() {
a.length && (n.push(a), a = []);
}
var s = e({
polygonStart: i,
polygonEnd: o,
lineStart: i,
lineEnd: o,
point: function(l, u) {
isFinite(l) && isFinite(u) && a.push([l, u]);
},
sphere: function() {
}
});
return !t && s.polygonStart(), A(r, function(l) {
s.lineStart();
for (var u = 0; u < l.length; u++)
s.point(l[u][0], l[u][1]);
s.lineEnd();
}), !t && s.polygonEnd(), n;
}
var RG = (
/** @class */
function(r) {
O(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t.type = e.type, t;
}
return e.prototype.render = function(t, n, a, i) {
if (!(i && i.type === "mapToggleSelect" && i.from === this.uid)) {
var o = this.group;
if (o.removeAll(), !t.getHostGeoModel()) {
if (this._mapDraw && i && i.type === "geoRoam" && this._mapDraw.resetForLabelLayout(), i && i.type === "geoRoam" && i.componentType === "series" && i.seriesId === t.id) {
var s = this._mapDraw;
s && o.add(s.group);
} else if (t.needsDrawMap) {
var s = this._mapDraw || new o2(a);
o.add(s.group), s.draw(t, n, a, this, i), this._mapDraw = s;
} else
this._mapDraw && this._mapDraw.remove(), this._mapDraw = null;
t.get("showLegendSymbol") && n.getComponent("legend") && this._renderSymbols(t, n, a);
}
}
}, e.prototype.remove = function() {
this._mapDraw && this._mapDraw.remove(), this._mapDraw = null, this.group.removeAll();
}, e.prototype.dispose = function() {
this._mapDraw && this._mapDraw.remove(), this._mapDraw = null;
}, e.prototype._renderSymbols = function(t, n, a) {
var i = t.originalData, o = this.group;
i.each(i.mapDimension("value"), function(s, l) {
if (!isNaN(s)) {
var u = i.getItemLayout(l);
if (!(!u || !u.point)) {
var h = u.point, f = u.offset, c = new Nn({
style: {
// Because the special of map draw.
// Which needs statistic of multiple series and draw on one map.
// And each series also need a symbol with legend color
//
// Layout and visual are put one the different data
// TODO
fill: t.getData().getVisual("style").fill
},
shape: {
cx: h[0] + f * 9,
cy: h[1],
r: 3
},
silent: !0,
// Do not overlap the first series, on which labels are displayed.
z2: 8 + (f ? 0 : zo + 1)
});
if (!f) {
var v = t.mainSeries.getData(), p = i.getName(l), d = v.indexOfName(p), g = i.getItemModel(l), y = g.getModel("label"), m = v.getItemGraphicEl(d);
xe(c, ve(g), {
labelFetcher: {
getFormattedLabel: function(_, S) {
return t.getFormattedLabel(d, S);
}
},
defaultText: p
}), c.disableLabelAnimation = !0, y.get("position") || c.setTextConfig({
position: "bottom"
}), m.onHoverStateChange = function(_) {
Bh(c, _);
};
}
o.add(c);
}
}
});
}, e.type = "map", e;
}(kt)
), NG = (
/** @class */
function(r) {
O(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t.type = e.type, t.needsDrawMap = !1, t.seriesGroup = [], t.getTooltipPosition = function(n) {
if (n != null) {
var a = this.getData().getName(n), i = this.coordinateSystem, o = i.getRegion(a);
return o && i.dataToPoint(o.getCenter());
}
}, t;
}
return e.prototype.getInitialData = function(t) {
for (var n = jo(this, {
coordDimensions: ["value"],
encodeDefaulter: ut(Iy, this)
}), a = X(), i = [], o = 0, s = n.count(); o < s; o++) {
var l = n.getName(o);
a.set(l, o);
}
var u = Pn.load(this.getMapType(), this.option.nameMap, this.option.nameProperty);
return A(u.regions, function(h) {
var f = h.name, c = a.get(f), v = h.properties && h.properties.echartsStyle, p;
c == null ? (p = {
name: f
}, i.push(p)) : p = n.getRawDataItem(c), v && ht(p, v);
}), n.appendData(i), n;
}, e.prototype.getHostGeoModel = function() {
var t = this.option.geoIndex;
return t != null ? this.ecModel.getComponent("geo", t) : null;
}, e.prototype.getMapType = function() {
return (this.getHostGeoModel() || this).option.map;
}, e.prototype.getRawValue = function(t) {
var n = this.getData();
return n.get(n.mapDimension("value"), t);
}, e.prototype.getRegionModel = function(t) {
var n = this.getData();
return n.getItemModel(n.indexOfName(t));
}, e.prototype.formatTooltip = function(t, n, a) {
for (var i = this.getData(), o = this.getRawValue(t), s = i.getName(t), l = this.seriesGroup, u = [], h = 0; h < l.length; h++) {
var f = l[h].originalData.indexOfName(s), c = i.mapDimension("value");
isNaN(l[h].originalData.get(c, f)) || u.push(l[h].name);
}
return pe("section", {
header: u.join(", "),
noHeader: !u.length,
blocks: [pe("nameValue", {
name: s,
value: o
})]
});
}, e.prototype.setZoom = function(t) {
this.option.zoom = t;
}, e.prototype.setCenter = function(t) {
this.option.center = t;
}, e.prototype.getLegendIcon = function(t) {
var n = t.icon || "roundRect", a = ae(n, 0, 0, t.itemWidth, t.itemHeight, t.itemStyle.fill);
return a.setStyle(t.itemStyle), a.style.stroke = "none", n.indexOf("empty") > -1 && (a.style.stroke = a.style.fill, a.style.fill = "#fff", a.style.lineWidth = 2), a;
}, e.type = "series.map", e.dependencies = ["geo"], e.layoutMode = "box", e.defaultOption = {
// 一级层叠
// zlevel: 0,
// 二级层叠
z: 2,
coordinateSystem: "geo",
// map should be explicitly specified since ec3.
map: "",
// If `geoIndex` is not specified, a exclusive geo will be
// created. Otherwise use the specified geo component, and
// `map` and `mapType` are ignored.
// geoIndex: 0,
// 'center' | 'left' | 'right' | 'x%' | {number}
left: "center",
// 'center' | 'top' | 'bottom' | 'x%' | {number}
top: "center",
// right
// bottom
// width:
// height
// Aspect is width / height. Inited to be geoJson bbox aspect
// This parameter is used for scale this aspect
// Default value:
// for geoSVG source: 1,
// for geoJSON source: 0.75.
aspectScale: null,
// Layout with center and size
// If you want to put map in a fixed size box with right aspect ratio
// This two properties may be more convenient.
// layoutCenter: [50%, 50%]
// layoutSize: 100
showLegendSymbol: !0,
// Define left-top, right-bottom coords to control view
// For example, [ [180, 90], [-180, -90] ],
// higher priority than center and zoom
boundingCoords: null,
// Default on center of map
center: null,
zoom: 1,
scaleLimit: null,
selectedMode: !0,
label: {
show: !1,
color: "#000"
},
// scaleLimit: null,
itemStyle: {
borderWidth: 0.5,
borderColor: "#444",
areaColor: "#eee"
},
emphasis: {
label: {
show: !0,
color: "rgb(100,0,0)"
},
itemStyle: {
areaColor: "rgba(255,215,0,0.8)"
}
},
select: {
label: {
show: !0,
color: "rgb(100,0,0)"
},
itemStyle: {
color: "rgba(255,215,0,0.8)"
}
},
nameProperty: "name"
}, e;
}(Ft)
);
function OG(r, e) {
var t = {};
return A(r, function(n) {
n.each(n.mapDimension("value"), function(a, i) {
var o = "ec-" + n.getName(i);
t[o] = t[o] || [], isNaN(a) || t[o].push(a);
});
}), r[0].map(r[0].mapDimension("value"), function(n, a) {
for (var i = "ec-" + r[0].getName(a), o = 0, s = 1 / 0, l = -1 / 0, u = t[i].length, h = 0; h < u; h++)
s = Math.min(s, t[i][h]), l = Math.max(l, t[i][h]), o += t[i][h];
var f;
return e === "min" ? f = s : e === "max" ? f = l : e === "average" ? f = o / u : f = o, u === 0 ? NaN : f;
});
}
function VG(r) {
var e = {};
r.eachSeriesByType("map", function(t) {
var n = t.getHostGeoModel(), a = n ? "o" + n.id : "i" + t.getMapType();
(e[a] = e[a] || []).push(t);
}), A(e, function(t, n) {
for (var a = OG(G(t, function(o) {
return o.getData();
}), t[0].get("mapValueCalculation")), i = 0; i < t.length; i++)
t[i].originalData = t[i].getData();
for (var i = 0; i < t.length; i++)
t[i].seriesGroup = t, t[i].needsDrawMap = i === 0 && !t[i].getHostGeoModel(), t[i].setData(a.cloneShallow()), t[i].mainSeries = t[0];
});
}
function BG(r) {
var e = {};
r.eachSeriesByType("map", function(t) {
var n = t.getMapType();
if (!(t.getHostGeoModel() || e[n])) {
var a = {};
A(t.seriesGroup, function(o) {
var s = o.coordinateSystem, l = o.originalData;
o.get("showLegendSymbol") && r.getComponent("legend") && l.each(l.mapDimension("value"), function(u, h) {
var f = l.getName(h), c = s.getRegion(f);
if (!(!c || isNaN(u))) {
var v = a[f] || 0, p = s.dataToPoint(c.getCenter());
a[f] = v + 1, l.setItemLayout(h, {
point: p,
offset: v
});
}
});
});
var i = t.getData();
i.each(function(o) {
var s = i.getName(o), l = i.getItemLayout(o) || {};
l.showLabel = !a[s], i.setItemLayout(o, l);
}), e[n] = !0;
}
});
}
var ux = me, Jl = (
/** @class */
function(r) {
O(e, r);
function e(t) {
var n = r.call(this) || this;
return n.type = "view", n.dimensions = ["x", "y"], n._roamTransformable = new mn(), n._rawTransformable = new mn(), n.name = t, n;
}
return e.prototype.setBoundingRect = function(t, n, a, i) {
return this._rect = new ct(t, n, a, i), this._rect;
}, e.prototype.getBoundingRect = function() {
return this._rect;
}, e.prototype.setViewRect = function(t, n, a, i) {
this._transformTo(t, n, a, i), this._viewRect = new ct(t, n, a, i);
}, e.prototype._transformTo = function(t, n, a, i) {
var o = this.getBoundingRect(), s = this._rawTransformable;
s.transform = o.calculateTransform(new ct(t, n, a, i));
var l = s.parent;
s.parent = null, s.decomposeTransform(), s.parent = l, this._updateTransform();
}, e.prototype.setCenter = function(t, n) {
t && (this._center = [W(t[0], n.getWidth()), W(t[1], n.getHeight())], this._updateCenterAndZoom());
}, e.prototype.setZoom = function(t) {
t = t || 1;
var n = this.zoomLimit;
n && (n.max != null && (t = Math.min(n.max, t)), n.min != null && (t = Math.max(n.min, t))), this._zoom = t, this._updateCenterAndZoom();
}, e.prototype.getDefaultCenter = function() {
var t = this.getBoundingRect(), n = t.x + t.width / 2, a = t.y + t.height / 2;
return [n, a];
}, e.prototype.getCenter = function() {
return this._center || this.getDefaultCenter();
}, e.prototype.getZoom = function() {
return this._zoom || 1;
}, e.prototype.getRoamTransform = function() {
return this._roamTransformable.getLocalTransform();
}, e.prototype._updateCenterAndZoom = function() {
var t = this._rawTransformable.getLocalTransform(), n = this._roamTransformable, a = this.getDefaultCenter(), i = this.getCenter(), o = this.getZoom();
i = me([], i, t), a = me([], a, t), n.originX = i[0], n.originY = i[1], n.x = a[0] - i[0], n.y = a[1] - i[1], n.scaleX = n.scaleY = o, this._updateTransform();
}, e.prototype._updateTransform = function() {
var t = this._roamTransformable, n = this._rawTransformable;
n.parent = t, t.updateTransform(), n.updateTransform(), ry(this.transform || (this.transform = []), n.transform || tr()), this._rawTransform = n.getLocalTransform(), this.invTransform = this.invTransform || [], Vo(this.invTransform, this.transform), this.decomposeTransform();
}, e.prototype.getTransformInfo = function() {
var t = this._rawTransformable, n = this._roamTransformable, a = new mn();
return a.transform = n.transform, a.decomposeTransform(), {
roam: {
x: a.x,
y: a.y,
scaleX: a.scaleX,
scaleY: a.scaleY
},
raw: {
x: t.x,
y: t.y,
scaleX: t.scaleX,
scaleY: t.scaleY
}
};
}, e.prototype.getViewRect = function() {
return this._viewRect;
}, e.prototype.getViewRectAfterRoam = function() {
var t = this.getBoundingRect().clone();
return t.applyTransform(this.transform), t;
}, e.prototype.dataToPoint = function(t, n, a) {
var i = n ? this._rawTransform : this.transform;
return a = a || [], i ? ux(a, t, i) : Le(a, t);
}, e.prototype.pointToData = function(t) {
var n = this.invTransform;
return n ? ux([], t, n) : [t[0], t[1]];
}, e.prototype.convertToPixel = function(t, n, a) {
var i = hx(n);
return i === this ? i.dataToPoint(a) : null;
}, e.prototype.convertFromPixel = function(t, n, a) {
var i = hx(n);
return i === this ? i.pointToData(a) : null;
}, e.prototype.containPoint = function(t) {
return this.getViewRectAfterRoam().contain(t[0], t[1]);
}, e.dimensions = ["x", "y"], e;
}(mn)
);
function hx(r) {
var e = r.seriesModel;
return e ? e.coordinateSystem : null;
}
var zG = {
geoJSON: {
aspectScale: 0.75,
invertLongitute: !0
},
geoSVG: {
aspectScale: 1,
invertLongitute: !1
}
}, s2 = ["lng", "lat"], sg = (
/** @class */
function(r) {
O(e, r);
function e(t, n, a) {
var i = r.call(this, t) || this;
i.dimensions = s2, i.type = "geo", i._nameCoordMap = X(), i.map = n;
var o = a.projection, s = Pn.load(n, a.nameMap, a.nameProperty), l = Pn.getGeoResource(n), u = i.resourceType = l ? l.type : null, h = i.regions = s.regions, f = zG[l.type];
i._regionsMap = s.regionsMap, i.regions = s.regions, process.env.NODE_ENV !== "production" && o && (u === "geoSVG" && (process.env.NODE_ENV !== "production" && Zt("Map " + n + " with SVG source can't use projection. Only GeoJSON source supports projection."), o = null), o.project && o.unproject || (process.env.NODE_ENV !== "production" && Zt("project and unproject must be both provided in the projeciton."), o = null)), i.projection = o;
var c;
if (o)
for (var v = 0; v < h.length; v++) {
var p = h[v].getBoundingRect(o);
c = c || p.clone(), c.union(p);
}
else
c = s.boundingRect;
return i.setBoundingRect(c.x, c.y, c.width, c.height), i.aspectScale = o ? 1 : ot(a.aspectScale, f.aspectScale), i._invertLongitute = o ? !1 : f.invertLongitute, i;
}
return e.prototype._transformTo = function(t, n, a, i) {
var o = this.getBoundingRect(), s = this._invertLongitute;
o = o.clone(), s && (o.y = -o.y - o.height);
var l = this._rawTransformable;
l.transform = o.calculateTransform(new ct(t, n, a, i));
var u = l.parent;
l.parent = null, l.decomposeTransform(), l.parent = u, s && (l.scaleY = -l.scaleY), this._updateTransform();
}, e.prototype.getRegion = function(t) {
return this._regionsMap.get(t);
}, e.prototype.getRegionByCoord = function(t) {
for (var n = this.regions, a = 0; a < n.length; a++) {
var i = n[a];
if (i.type === "geoJSON" && i.contain(t))
return n[a];
}
}, e.prototype.addGeoCoord = function(t, n) {
this._nameCoordMap.set(t, n);
}, e.prototype.getGeoCoord = function(t) {
var n = this._regionsMap.get(t);
return this._nameCoordMap.get(t) || n && n.getCenter();
}, e.prototype.dataToPoint = function(t, n, a) {
if (U(t) && (t = this.getGeoCoord(t)), t) {
var i = this.projection;
return i && (t = i.project(t)), t && this.projectedToPoint(t, n, a);
}
}, e.prototype.pointToData = function(t) {
var n = this.projection;
return n && (t = n.unproject(t)), t && this.pointToProjected(t);
}, e.prototype.pointToProjected = function(t) {
return r.prototype.pointToData.call(this, t);
}, e.prototype.projectedToPoint = function(t, n, a) {
return r.prototype.dataToPoint.call(this, t, n, a);
}, e.prototype.convertToPixel = function(t, n, a) {
var i = fx(n);
return i === this ? i.dataToPoint(a) : null;
}, e.prototype.convertFromPixel = function(t, n, a) {
var i = fx(n);
return i === this ? i.pointToData(a) : null;
}, e;
}(Jl)
);
ie(sg, Jl);
function fx(r) {
var e = r.geoModel, t = r.seriesModel;
return e ? e.coordinateSystem : t ? t.coordinateSystem || (t.getReferringComponents("geo", ne).models[0] || {}).coordinateSystem : null;
}
function cx(r, e) {
var t = r.get("boundingCoords");
if (t != null) {
var n = t[0], a = t[1];
if (!(isFinite(n[0]) && isFinite(n[1]) && isFinite(a[0]) && isFinite(a[1])))
process.env.NODE_ENV !== "production" && console.error("Invalid boundingCoords");
else {
var i = this.projection;
if (i) {
var o = n[0], s = n[1], l = a[0], u = a[1];
n = [1 / 0, 1 / 0], a = [-1 / 0, -1 / 0];
var h = function(b, w, T, C) {
for (var D = T - b, M = C - w, I = 0; I <= 100; I++) {
var L = I / 100, E = i.project([b + D * L, w + M * L]);
Qn(n, n, E), Jn(a, a, E);
}
};
h(o, s, l, s), h(l, s, l, u), h(l, u, o, u), h(o, u, l, s);
}
this.setBoundingRect(n[0], n[1], a[0] - n[0], a[1] - n[1]);
}
}
var f = this.getBoundingRect(), c = r.get("layoutCenter"), v = r.get("layoutSize"), p = e.getWidth(), d = e.getHeight(), g = f.width / f.height * this.aspectScale, y = !1, m, _;
c && v && (m = [W(c[0], p), W(c[1], d)], _ = W(v, Math.min(p, d)), !isNaN(m[0]) && !isNaN(m[1]) && !isNaN(_) ? y = !0 : process.env.NODE_ENV !== "production" && console.warn("Given layoutCenter or layoutSize data are invalid. Use left/top/width/height instead."));
var S;
if (y)
S = {}, g > 1 ? (S.width = _, S.height = _ / g) : (S.height = _, S.width = _ * g), S.y = m[1] - S.height / 2, S.x = m[0] - S.width / 2;
else {
var x = r.getBoxLayoutParams();
x.aspect = g, S = se(x, {
width: p,
height: d
});
}
this.setViewRect(S.x, S.y, S.width, S.height), this.setCenter(r.get("center"), e), this.setZoom(r.get("zoom"));
}
function GG(r, e) {
A(e.get("geoCoord"), function(t, n) {
r.addGeoCoord(n, t);
});
}
var FG = (
/** @class */
function() {
function r() {
this.dimensions = s2;
}
return r.prototype.create = function(e, t) {
var n = [];
function a(o) {
return {
nameProperty: o.get("nameProperty"),
aspectScale: o.get("aspectScale"),
projection: o.get("projection")
};
}
e.eachComponent("geo", function(o, s) {
var l = o.get("map"), u = new sg(l + s, l, B({
nameMap: o.get("nameMap")
}, a(o)));
u.zoomLimit = o.get("scaleLimit"), n.push(u), o.coordinateSystem = u, u.model = o, u.resize = cx, u.resize(o, t);
}), e.eachSeries(function(o) {
var s = o.get("coordinateSystem");
if (s === "geo") {
var l = o.get("geoIndex") || 0;
o.coordinateSystem = n[l];
}
});
var i = {};
return e.eachSeriesByType("map", function(o) {
if (!o.getHostGeoModel()) {
var s = o.getMapType();
i[s] = i[s] || [], i[s].push(o);
}
}), A(i, function(o, s) {
var l = G(o, function(h) {
return h.get("nameMap");
}), u = new sg(s, s, B({
nameMap: Qg(l)
}, a(o[0])));
u.zoomLimit = re.apply(null, G(o, function(h) {
return h.get("scaleLimit");
})), n.push(u), u.resize = cx, u.resize(o[0], t), A(o, function(h) {
h.coordinateSystem = u, GG(u, h);
});
}), n;
}, r.prototype.getFilledRegions = function(e, t, n, a) {
for (var i = (e || []).slice(), o = X(), s = 0; s < i.length; s++)
o.set(i[s].name, i[s]);
var l = Pn.load(t, n, a);
return A(l.regions, function(u) {
var h = u.name, f = o.get(h), c = u.properties && u.properties.echartsStyle;
f || (f = {
name: h
}, i.push(f)), c && ht(f, c);
}), i;
}, r;
}()
), l2 = new FG(), HG = (
/** @class */
function(r) {
O(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t.type = e.type, t;
}
return e.prototype.init = function(t, n, a) {
var i = Pn.getGeoResource(t.map);
if (i && i.type === "geoJSON") {
var o = t.itemStyle = t.itemStyle || {};
"color" in o || (o.color = "#eee");
}
this.mergeDefaultAndTheme(t, a), xi(t, "label", ["show"]);
}, e.prototype.optionUpdated = function() {
var t = this, n = this.option;
n.regions = l2.getFilledRegions(n.regions, n.map, n.nameMap, n.nameProperty);
var a = {};
this._optionModelMap = rn(n.regions || [], function(i, o) {
var s = o.name;
return s && (i.set(s, new It(o, t, t.ecModel)), o.selected && (a[s] = !0)), i;
}, X()), n.selectedMap || (n.selectedMap = a);
}, e.prototype.getRegionModel = function(t) {
return this._optionModelMap.get(t) || new It(null, this, this.ecModel);
}, e.prototype.getFormattedLabel = function(t, n) {
var a = this.getRegionModel(t), i = n === "normal" ? a.get(["label", "formatter"]) : a.get(["emphasis", "label", "formatter"]), o = {
name: t
};
if (K(i))
return o.status = n, i(o);
if (U(i))
return i.replace("{a}", t ?? "");
}, e.prototype.setZoom = function(t) {
this.option.zoom = t;
}, e.prototype.setCenter = function(t) {
this.option.center = t;
}, e.prototype.select = function(t) {
var n = this.option, a = n.selectedMode;
if (a) {
a !== "multiple" && (n.selectedMap = null);
var i = n.selectedMap || (n.selectedMap = {});
i[t] = !0;
}
}, e.prototype.unSelect = function(t) {
var n = this.option.selectedMap;
n && (n[t] = !1);
}, e.prototype.toggleSelected = function(t) {
this[this.isSelected(t) ? "unSelect" : "select"](t);
}, e.prototype.isSelected = function(t) {
var n = this.option.selectedMap;
return !!(n && n[t]);
}, e.type = "geo", e.layoutMode = "box", e.defaultOption = {
// zlevel: 0,
z: 0,
show: !0,
left: "center",
top: "center",
// Default value:
// for geoSVG source: 1,
// for geoJSON source: 0.75.
aspectScale: null,
// /// Layout with center and size
// If you want to put map in a fixed size box with right aspect ratio
// This two properties may be more convenient
// layoutCenter: [50%, 50%]
// layoutSize: 100
silent: !1,
// Map type
map: "",
// Define left-top, right-bottom coords to control view
// For example, [ [180, 90], [-180, -90] ]
boundingCoords: null,
// Default on center of map
center: null,
zoom: 1,
scaleLimit: null,
// selectedMode: false
label: {
show: !1,
color: "#000"
},
itemStyle: {
borderWidth: 0.5,
borderColor: "#444"
// Default color:
// + geoJSON: #eee
// + geoSVG: null (use SVG original `fill`)
// color: '#eee'
},
emphasis: {
label: {
show: !0,
color: "rgb(100,0,0)"
},
itemStyle: {
color: "rgba(255,215,0,0.8)"
}
},
select: {
label: {
show: !0,
color: "rgb(100,0,0)"
},
itemStyle: {
color: "rgba(255,215,0,0.8)"
}
},
regions: []
// tooltip: {
// show: false
// }
}, e;
}(_t)
);
function vx(r, e) {
return r.pointToProjected ? r.pointToProjected(e) : r.pointToData(e);
}
function hm(r, e, t, n) {
var a = r.getZoom(), i = r.getCenter(), o = e.zoom, s = r.projectedToPoint ? r.projectedToPoint(i) : r.dataToPoint(i);
if (e.dx != null && e.dy != null && (s[0] -= e.dx, s[1] -= e.dy, r.setCenter(vx(r, s), n)), o != null) {
if (t) {
var l = t.min || 0, u = t.max || 1 / 0;
o = Math.max(Math.min(a * o, u), l) / a;
}
r.scaleX *= o, r.scaleY *= o;
var h = (e.originX - r.x) * (o - 1), f = (e.originY - r.y) * (o - 1);
r.x -= h, r.y -= f, r.updateTransform(), r.setCenter(vx(r, s), n), r.setZoom(o * a);
}
return {
center: r.getCenter(),
zoom: r.getZoom()
};
}
var WG = (
/** @class */
function(r) {
O(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t.type = e.type, t.focusBlurEnabled = !0, t;
}
return e.prototype.init = function(t, n) {
this._api = n;
}, e.prototype.render = function(t, n, a, i) {
if (this._model = t, !t.get("show")) {
this._mapDraw && this._mapDraw.remove(), this._mapDraw = null;
return;
}
this._mapDraw || (this._mapDraw = new o2(a));
var o = this._mapDraw;
o.draw(t, n, a, this, i), o.group.on("click", this._handleRegionClick, this), o.group.silent = t.get("silent"), this.group.add(o.group), this.updateSelectStatus(t, n, a);
}, e.prototype._handleRegionClick = function(t) {
var n;
ii(t.target, function(a) {
return (n = it(a).eventData) != null;
}, !0), n && this._api.dispatchAction({
type: "geoToggleSelect",
geoId: this._model.id,
name: n.name
});
}, e.prototype.updateSelectStatus = function(t, n, a) {
var i = this;
this._mapDraw.group.traverse(function(o) {
var s = it(o).eventData;
if (s)
return i._model.isSelected(s.name) ? a.enterSelect(o) : a.leaveSelect(o), !0;
});
}, e.prototype.findHighDownDispatchers = function(t) {
return this._mapDraw && this._mapDraw.findHighDownDispatchers(t, this._model);
}, e.prototype.dispose = function() {
this._mapDraw && this._mapDraw.remove();
}, e.type = "geo", e;
}(Yt)
);
function $G(r, e, t) {
Pn.registerMap(r, e, t);
}
function u2(r) {
r.registerCoordinateSystem("geo", l2), r.registerComponentModel(HG), r.registerComponentView(WG), r.registerImpl("registerMap", $G), r.registerImpl("getMap", function(t) {
return Pn.getMapForUser(t);
});
function e(t, n) {
n.update = "geo:updateSelectStatus", r.registerAction(n, function(a, i) {
var o = {}, s = [];
return i.eachComponent({
mainType: "geo",
query: a
}, function(l) {
l[t](a.name);
var u = l.coordinateSystem;
A(u.regions, function(f) {
o[f.name] = l.isSelected(f.name) || !1;
});
var h = [];
A(o, function(f, c) {
o[c] && h.push(c);
}), s.push({
geoIndex: l.componentIndex,
// Use singular, the same naming convention as the event `selectchanged`.
name: h
});
}), {
selected: o,
allSelected: s,
name: a.name
};
});
}
e("toggleSelected", {
type: "geoToggleSelect",
event: "geoselectchanged"
}), e("select", {
type: "geoSelect",
event: "geoselected"
}), e("unSelect", {
type: "geoUnSelect",
event: "geounselected"
}), r.registerAction({
type: "geoRoam",
event: "geoRoam",
update: "updateTransform"
}, function(t, n, a) {
var i = t.componentType || "series";
n.eachComponent({
mainType: i,
query: t
}, function(o) {
var s = o.coordinateSystem;
if (s.type === "geo") {
var l = hm(s, t, o.get("scaleLimit"), a);
o.setCenter && o.setCenter(l.center), o.setZoom && o.setZoom(l.zoom), i === "series" && A(o.seriesGroup, function(u) {
u.setCenter(l.center), u.setZoom(l.zoom);
});
}
});
});
}
function UG(r) {
gt(u2), r.registerChartView(RG), r.registerSeriesModel(NG), r.registerLayout(BG), r.registerProcessor(r.PRIORITY.PROCESSOR.STATISTIC, VG), fA("map", r.registerAction);
}
function YG(r) {
var e = r;
e.hierNode = {
defaultAncestor: null,
ancestor: e,
prelim: 0,
modifier: 0,
change: 0,
shift: 0,
i: 0,
thread: null
};
for (var t = [e], n, a; n = t.pop(); )
if (a = n.children, n.isExpand && a.length)
for (var i = a.length, o = i - 1; o >= 0; o--) {
var s = a[o];
s.hierNode = {
defaultAncestor: null,
ancestor: s,
prelim: 0,
modifier: 0,
change: 0,
shift: 0,
i: o,
thread: null
}, t.push(s);
}
}
function ZG(r, e) {
var t = r.isExpand ? r.children : [], n = r.parentNode.children, a = r.hierNode.i ? n[r.hierNode.i - 1] : null;
if (t.length) {
KG(r);
var i = (t[0].hierNode.prelim + t[t.length - 1].hierNode.prelim) / 2;
a ? (r.hierNode.prelim = a.hierNode.prelim + e(r, a), r.hierNode.modifier = r.hierNode.prelim - i) : r.hierNode.prelim = i;
} else a && (r.hierNode.prelim = a.hierNode.prelim + e(r, a));
r.parentNode.hierNode.defaultAncestor = jG(r, a, r.parentNode.hierNode.defaultAncestor || n[0], e);
}
function XG(r) {
var e = r.hierNode.prelim + r.parentNode.hierNode.modifier;
r.setLayout({
x: e
}, !0), r.hierNode.modifier += r.parentNode.hierNode.modifier;
}
function px(r) {
return arguments.length ? r : tF;
}
function zs(r, e) {
return r -= Math.PI / 2, {
x: e * Math.cos(r),
y: e * Math.sin(r)
};
}
function qG(r, e) {
return se(r.getBoxLayoutParams(), {
width: e.getWidth(),
height: e.getHeight()
});
}
function KG(r) {
for (var e = r.children, t = e.length, n = 0, a = 0; --t >= 0; ) {
var i = e[t];
i.hierNode.prelim += n, i.hierNode.modifier += n, a += i.hierNode.change, n += i.hierNode.shift + a;
}
}
function jG(r, e, t, n) {
if (e) {
for (var a = r, i = r, o = i.parentNode.children[0], s = e, l = a.hierNode.modifier, u = i.hierNode.modifier, h = o.hierNode.modifier, f = s.hierNode.modifier; s = Xv(s), i = qv(i), s && i; ) {
a = Xv(a), o = qv(o), a.hierNode.ancestor = r;
var c = s.hierNode.prelim + f - i.hierNode.prelim - u + n(s, i);
c > 0 && (JG(QG(s, r, t), r, c), u += c, l += c), f += s.hierNode.modifier, u += i.hierNode.modifier, l += a.hierNode.modifier, h += o.hierNode.modifier;
}
s && !Xv(a) && (a.hierNode.thread = s, a.hierNode.modifier += f - l), i && !qv(o) && (o.hierNode.thread = i, o.hierNode.modifier += u - h, t = r);
}
return t;
}
function Xv(r) {
var e = r.children;
return e.length && r.isExpand ? e[e.length - 1] : r.hierNode.thread;
}
function qv(r) {
var e = r.children;
return e.length && r.isExpand ? e[0] : r.hierNode.thread;
}
function QG(r, e, t) {
return r.hierNode.ancestor.parentNode === e.parentNode ? r.hierNode.ancestor : t;
}
function JG(r, e, t) {
var n = t / (e.hierNode.i - r.hierNode.i);
e.hierNode.change -= n, e.hierNode.shift += t, e.hierNode.modifier += t, e.hierNode.prelim += t, r.hierNode.change += n;
}
function tF(r, e) {
return r.parentNode === e.parentNode ? 1 : 2;
}
var eF = (
/** @class */
/* @__PURE__ */ function() {
function r() {
this.parentPoint = [], this.childPoints = [];
}
return r;
}()
), rF = (
/** @class */
function(r) {
O(e, r);
function e(t) {
return r.call(this, t) || this;
}
return e.prototype.getDefaultStyle = function() {
return {
stroke: "#000",
fill: null
};
}, e.prototype.getDefaultShape = function() {
return new eF();
}, e.prototype.buildPath = function(t, n) {
var a = n.childPoints, i = a.length, o = n.parentPoint, s = a[0], l = a[i - 1];
if (i === 1) {
t.moveTo(o[0], o[1]), t.lineTo(s[0], s[1]);
return;
}
var u = n.orient, h = u === "TB" || u === "BT" ? 0 : 1, f = 1 - h, c = W(n.forkPosition, 1), v = [];
v[h] = o[h], v[f] = o[f] + (l[f] - o[f]) * c, t.moveTo(o[0], o[1]), t.lineTo(v[0], v[1]), t.moveTo(s[0], s[1]), v[h] = s[h], t.lineTo(v[0], v[1]), v[h] = l[h], t.lineTo(v[0], v[1]), t.lineTo(l[0], l[1]);
for (var p = 1; p < i - 1; p++) {
var d = a[p];
t.moveTo(d[0], d[1]), v[h] = d[h], t.lineTo(v[0], v[1]);
}
}, e;
}(mt)
), nF = (
/** @class */
function(r) {
O(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t.type = e.type, t._mainGroup = new at(), t;
}
return e.prototype.init = function(t, n) {
this._controller = new Ql(n.getZr()), this._controllerHost = {
target: this.group
}, this.group.add(this._mainGroup);
}, e.prototype.render = function(t, n, a) {
var i = t.getData(), o = t.layoutInfo, s = this._mainGroup, l = t.get("layout");
l === "radial" ? (s.x = o.x + o.width / 2, s.y = o.y + o.height / 2) : (s.x = o.x, s.y = o.y), this._updateViewCoordSys(t, a), this._updateController(t, n, a);
var u = this._data;
i.diff(u).add(function(h) {
dx(i, h) && gx(i, h, null, s, t);
}).update(function(h, f) {
var c = u.getItemGraphicEl(f);
if (!dx(i, h)) {
c && mx(u, f, c, s, t);
return;
}
gx(i, h, c, s, t);
}).remove(function(h) {
var f = u.getItemGraphicEl(h);
f && mx(u, h, f, s, t);
}).execute(), this._nodeScaleRatio = t.get("nodeScaleRatio"), this._updateNodeAndLinkScale(t), t.get("expandAndCollapse") === !0 && i.eachItemGraphicEl(function(h, f) {
h.off("click").on("click", function() {
a.dispatchAction({
type: "treeExpandAndCollapse",
seriesId: t.id,
dataIndex: f
});
});
}), this._data = i;
}, e.prototype._updateViewCoordSys = function(t, n) {
var a = t.getData(), i = [];
a.each(function(f) {
var c = a.getItemLayout(f);
c && !isNaN(c.x) && !isNaN(c.y) && i.push([+c.x, +c.y]);
});
var o = [], s = [];
Hf(i, o, s);
var l = this._min, u = this._max;
s[0] - o[0] === 0 && (o[0] = l ? l[0] : o[0] - 1, s[0] = u ? u[0] : s[0] + 1), s[1] - o[1] === 0 && (o[1] = l ? l[1] : o[1] - 1, s[1] = u ? u[1] : s[1] + 1);
var h = t.coordinateSystem = new Jl();
h.zoomLimit = t.get("scaleLimit"), h.setBoundingRect(o[0], o[1], s[0] - o[0], s[1] - o[1]), h.setCenter(t.get("center"), n), h.setZoom(t.get("zoom")), this.group.attr({
x: h.x,
y: h.y,
scaleX: h.scaleX,
scaleY: h.scaleY
}), this._min = o, this._max = s;
}, e.prototype._updateController = function(t, n, a) {
var i = this, o = this._controller, s = this._controllerHost, l = this.group;
o.setPointerChecker(function(u, h, f) {
var c = l.getBoundingRect();
return c.applyTransform(l.transform), c.contain(h, f) && !cc(u, a, t);
}), o.enable(t.get("roam")), s.zoomLimit = t.get("scaleLimit"), s.zoom = t.coordinateSystem.getZoom(), o.off("pan").off("zoom").on("pan", function(u) {
sm(s, u.dx, u.dy), a.dispatchAction({
seriesId: t.id,
type: "treeRoam",
dx: u.dx,
dy: u.dy
});
}).on("zoom", function(u) {
lm(s, u.scale, u.originX, u.originY), a.dispatchAction({
seriesId: t.id,
type: "treeRoam",
zoom: u.scale,
originX: u.originX,
originY: u.originY
}), i._updateNodeAndLinkScale(t), a.updateLabelLayout();
});
}, e.prototype._updateNodeAndLinkScale = function(t) {
var n = t.getData(), a = this._getNodeGlobalScale(t);
n.eachItemGraphicEl(function(i, o) {
i.setSymbolScale(a);
});
}, e.prototype._getNodeGlobalScale = function(t) {
var n = t.coordinateSystem;
if (n.type !== "view")
return 1;
var a = this._nodeScaleRatio, i = n.scaleX || 1, o = n.getZoom(), s = (o - 1) * a + 1;
return s / i;
}, e.prototype.dispose = function() {
this._controller && this._controller.dispose(), this._controllerHost = null;
}, e.prototype.remove = function() {
this._mainGroup.removeAll(), this._data = null;
}, e.type = "tree", e;
}(kt)
);
function dx(r, e) {
var t = r.getItemLayout(e);
return t && !isNaN(t.x) && !isNaN(t.y);
}
function gx(r, e, t, n, a) {
var i = !t, o = r.tree.getNodeByDataIndex(e), s = o.getModel(), l = o.getVisual("style").fill, u = o.isExpand === !1 && o.children.length !== 0 ? l : "#fff", h = r.tree.root, f = o.parentNode === h ? o : o.parentNode || o, c = r.getItemGraphicEl(f.dataIndex), v = f.getLayout(), p = c ? {
x: c.__oldX,
y: c.__oldY,
rawX: c.__radialOldRawX,
rawY: c.__radialOldRawY
} : v, d = o.getLayout();
i ? (t = new Yl(r, e, null, {
symbolInnerColor: u,
useNameLabel: !0
}), t.x = p.x, t.y = p.y) : t.updateData(r, e, null, {
symbolInnerColor: u,
useNameLabel: !0
}), t.__radialOldRawX = t.__radialRawX, t.__radialOldRawY = t.__radialRawY, t.__radialRawX = d.rawX, t.__radialRawY = d.rawY, n.add(t), r.setItemGraphicEl(e, t), t.__oldX = t.x, t.__oldY = t.y, Ct(t, {
x: d.x,
y: d.y
}, a);
var g = t.getSymbolPath();
if (a.get("layout") === "radial") {
var y = h.children[0], m = y.getLayout(), _ = y.children.length, S = void 0, x = void 0;
if (d.x === m.x && o.isExpand === !0 && y.children.length) {
var b = {
x: (y.children[0].getLayout().x + y.children[_ - 1].getLayout().x) / 2,
y: (y.children[0].getLayout().y + y.children[_ - 1].getLayout().y) / 2
};
S = Math.atan2(b.y - m.y, b.x - m.x), S < 0 && (S = Math.PI * 2 + S), x = b.x < m.x, x && (S = S - Math.PI);
} else
S = Math.atan2(d.y - m.y, d.x - m.x), S < 0 && (S = Math.PI * 2 + S), o.children.length === 0 || o.children.length !== 0 && o.isExpand === !1 ? (x = d.x < m.x, x && (S = S - Math.PI)) : (x = d.x > m.x, x || (S = S - Math.PI));
var w = x ? "left" : "right", T = s.getModel("label"), C = T.get("rotate"), D = C * (Math.PI / 180), M = g.getTextContent();
M && (g.setTextConfig({
position: T.get("position") || w,
rotation: C == null ? -S : D,
origin: "center"
}), M.setStyle("verticalAlign", "middle"));
}
var I = s.get(["emphasis", "focus"]), L = I === "relative" ? ol(o.getAncestorsIndices(), o.getDescendantIndices()) : I === "ancestor" ? o.getAncestorsIndices() : I === "descendant" ? o.getDescendantIndices() : null;
L && (it(t).focus = L), aF(a, o, h, t, p, v, d, n), t.__edge && (t.onHoverStateChange = function(E) {
if (E !== "blur") {
var P = o.parentNode && r.getItemGraphicEl(o.parentNode.dataIndex);
P && P.hoverState === Vl || Bh(t.__edge, E);
}
});
}
function aF(r, e, t, n, a, i, o, s) {
var l = e.getModel(), u = r.get("edgeShape"), h = r.get("layout"), f = r.getOrient(), c = r.get(["lineStyle", "curveness"]), v = r.get("edgeForkPosition"), p = l.getModel("lineStyle").getLineStyle(), d = n.__edge;
if (u === "curve")
e.parentNode && e.parentNode !== t && (d || (d = n.__edge = new zl({
shape: lg(h, f, c, a, a)
})), Ct(d, {
shape: lg(h, f, c, i, o)
}, r));
else if (u === "polyline") {
if (h === "orthogonal") {
if (e !== t && e.children && e.children.length !== 0 && e.isExpand === !0) {
for (var g = e.children, y = [], m = 0; m < g.length; m++) {
var _ = g[m].getLayout();
y.push([_.x, _.y]);
}
d || (d = n.__edge = new rF({
shape: {
parentPoint: [o.x, o.y],
childPoints: [[o.x, o.y]],
orient: f,
forkPosition: v
}
})), Ct(d, {
shape: {
parentPoint: [o.x, o.y],
childPoints: y
}
}, r);
}
} else if (process.env.NODE_ENV !== "production")
throw new Error("The polyline edgeShape can only be used in orthogonal layout");
}
d && !(u === "polyline" && !e.isExpand) && (d.useStyle(et({
strokeNoScale: !0,
fill: null
}, p)), Se(d, l, "lineStyle"), Ti(d), s.add(d));
}
function yx(r, e, t, n, a) {
var i = e.tree.root, o = h2(i, r), s = o.source, l = o.sourceLayout, u = e.getItemGraphicEl(r.dataIndex);
if (u) {
var h = e.getItemGraphicEl(s.dataIndex), f = h.__edge, c = u.__edge || (s.isExpand === !1 || s.children.length === 1 ? f : void 0), v = n.get("edgeShape"), p = n.get("layout"), d = n.get("orient"), g = n.get(["lineStyle", "curveness"]);
c && (v === "curve" ? va(c, {
shape: lg(p, d, g, l, l),
style: {
opacity: 0
}
}, n, {
cb: function() {
t.remove(c);
},
removeOpt: a
}) : v === "polyline" && n.get("layout") === "orthogonal" && va(c, {
shape: {
parentPoint: [l.x, l.y],
childPoints: [[l.x, l.y]]
},
style: {
opacity: 0
}
}, n, {
cb: function() {
t.remove(c);
},
removeOpt: a
}));
}
}
function h2(r, e) {
for (var t = e.parentNode === r ? e : e.parentNode || e, n; n = t.getLayout(), n == null; )
t = t.parentNode === r ? t : t.parentNode || t;
return {
source: t,
sourceLayout: n
};
}
function mx(r, e, t, n, a) {
var i = r.tree.getNodeByDataIndex(e), o = r.tree.root, s = h2(o, i).sourceLayout, l = {
duration: a.get("animationDurationUpdate"),
easing: a.get("animationEasingUpdate")
};
va(t, {
x: s.x + 1,
y: s.y + 1
}, a, {
cb: function() {
n.remove(t), r.setItemGraphicEl(e, null);
},
removeOpt: l
}), t.fadeOut(null, r.hostModel, {
fadeLabel: !0,
animation: l
}), i.children.forEach(function(u) {
yx(u, r, n, a, l);
}), yx(i, r, n, a, l);
}
function lg(r, e, t, n, a) {
var i, o, s, l, u, h, f, c;
if (r === "radial") {
u = n.rawX, f = n.rawY, h = a.rawX, c = a.rawY;
var v = zs(u, f), p = zs(u, f + (c - f) * t), d = zs(h, c + (f - c) * t), g = zs(h, c);
return {
x1: v.x || 0,
y1: v.y || 0,
x2: g.x || 0,
y2: g.y || 0,
cpx1: p.x || 0,
cpy1: p.y || 0,
cpx2: d.x || 0,
cpy2: d.y || 0
};
} else
u = n.x, f = n.y, h = a.x, c = a.y, (e === "LR" || e === "RL") && (i = u + (h - u) * t, o = f, s = h + (u - h) * t, l = c), (e === "TB" || e === "BT") && (i = u, o = f + (c - f) * t, s = h, l = c + (f - c) * t);
return {
x1: u,
y1: f,
x2: h,
y2: c,
cpx1: i,
cpy1: o,
cpx2: s,
cpy2: l
};
}
var _r = bt();
function f2(r) {
var e = r.mainData, t = r.datas;
t || (t = {
main: e
}, r.datasAttr = {
main: "data"
}), r.datas = r.mainData = null, c2(e, t, r), A(t, function(n) {
A(e.TRANSFERABLE_METHODS, function(a) {
n.wrapMethod(a, ut(iF, r));
});
}), e.wrapMethod("cloneShallow", ut(sF, r)), A(e.CHANGABLE_METHODS, function(n) {
e.wrapMethod(n, ut(oF, r));
}), tt(t[e.dataType] === e);
}
function iF(r, e) {
if (hF(this)) {
var t = B({}, _r(this).datas);
t[this.dataType] = e, c2(e, t, r);
} else
fm(e, this.dataType, _r(this).mainData, r);
return e;
}
function oF(r, e) {
return r.struct && r.struct.update(), e;
}
function sF(r, e) {
return A(_r(e).datas, function(t, n) {
t !== e && fm(t.cloneShallow(), n, e, r);
}), e;
}
function lF(r) {
var e = _r(this).mainData;
return r == null || e == null ? e : _r(e).datas[r];
}
function uF() {
var r = _r(this).mainData;
return r == null ? [{
data: r
}] : G(St(_r(r).datas), function(e) {
return {
type: e,
data: _r(r).datas[e]
};
});
}
function hF(r) {
return _r(r).mainData === r;
}
function c2(r, e, t) {
_r(r).datas = {}, A(e, function(n, a) {
fm(n, a, r, t);
});
}
function fm(r, e, t, n) {
_r(t).datas[e] = r, _r(r).mainData = t, r.dataType = e, n.struct && (r[n.structAttr] = n.struct, n.struct[n.datasAttr[e]] = r), r.getLinkedData = lF, r.getLinkedDataAll = uF;
}
var fF = (
/** @class */
function() {
function r(e, t) {
this.depth = 0, this.height = 0, this.dataIndex = -1, this.children = [], this.viewChildren = [], this.isExpand = !1, this.name = e || "", this.hostTree = t;
}
return r.prototype.isRemoved = function() {
return this.dataIndex < 0;
}, r.prototype.eachNode = function(e, t, n) {
K(e) && (n = t, t = e, e = null), e = e || {}, U(e) && (e = {
order: e
});
var a = e.order || "preorder", i = this[e.attr || "children"], o;
a === "preorder" && (o = t.call(n, this));
for (var s = 0; !o && s < i.length; s++)
i[s].eachNode(e, t, n);
a === "postorder" && t.call(n, this);
}, r.prototype.updateDepthAndHeight = function(e) {
var t = 0;
this.depth = e;
for (var n = 0; n < this.children.length; n++) {
var a = this.children[n];
a.updateDepthAndHeight(e + 1), a.height > t && (t = a.height);
}
this.height = t + 1;
}, r.prototype.getNodeById = function(e) {
if (this.getId() === e)
return this;
for (var t = 0, n = this.children, a = n.length; t < a; t++) {
var i = n[t].getNodeById(e);
if (i)
return i;
}
}, r.prototype.contains = function(e) {
if (e === this)
return !0;
for (var t = 0, n = this.children, a = n.length; t < a; t++) {
var i = n[t].contains(e);
if (i)
return i;
}
}, r.prototype.getAncestors = function(e) {
for (var t = [], n = e ? this : this.parentNode; n; )
t.push(n), n = n.parentNode;
return t.reverse(), t;
}, r.prototype.getAncestorsIndices = function() {
for (var e = [], t = this; t; )
e.push(t.dataIndex), t = t.parentNode;
return e.reverse(), e;
}, r.prototype.getDescendantIndices = function() {
var e = [];
return this.eachNode(function(t) {
e.push(t.dataIndex);
}), e;
}, r.prototype.getValue = function(e) {
var t = this.hostTree.data;
return t.getStore().get(t.getDimensionIndex(e || "value"), this.dataIndex);
}, r.prototype.setLayout = function(e, t) {
this.dataIndex >= 0 && this.hostTree.data.setItemLayout(this.dataIndex, e, t);
}, r.prototype.getLayout = function() {
return this.hostTree.data.getItemLayout(this.dataIndex);
}, r.prototype.getModel = function(e) {
if (!(this.dataIndex < 0)) {
var t = this.hostTree, n = t.data.getItemModel(this.dataIndex);
return n.getModel(e);
}
}, r.prototype.getLevelModel = function() {
return (this.hostTree.levelModels || [])[this.depth];
}, r.prototype.setVisual = function(e, t) {
this.dataIndex >= 0 && this.hostTree.data.setItemVisual(this.dataIndex, e, t);
}, r.prototype.getVisual = function(e) {
return this.hostTree.data.getItemVisual(this.dataIndex, e);
}, r.prototype.getRawIndex = function() {
return this.hostTree.data.getRawIndex(this.dataIndex);
}, r.prototype.getId = function() {
return this.hostTree.data.getId(this.dataIndex);
}, r.prototype.getChildIndex = function() {
if (this.parentNode) {
for (var e = this.parentNode.children, t = 0; t < e.length; ++t)
if (e[t] === this)
return t;
return -1;
}
return -1;
}, r.prototype.isAncestorOf = function(e) {
for (var t = e.parentNode; t; ) {
if (t === this)
return !0;
t = t.parentNode;
}
return !1;
}, r.prototype.isDescendantOf = function(e) {
return e !== this && e.isAncestorOf(this);
}, r;
}()
), cm = (
/** @class */
function() {
function r(e) {
this.type = "tree", this._nodes = [], this.hostModel = e;
}
return r.prototype.eachNode = function(e, t, n) {
this.root.eachNode(e, t, n);
}, r.prototype.getNodeByDataIndex = function(e) {
var t = this.data.getRawIndex(e);
return this._nodes[t];
}, r.prototype.getNodeById = function(e) {
return this.root.getNodeById(e);
}, r.prototype.update = function() {
for (var e = this.data, t = this._nodes, n = 0, a = t.length; n < a; n++)
t[n].dataIndex = -1;
for (var n = 0, a = e.count(); n < a; n++)
t[e.getRawIndex(n)].dataIndex = n;
}, r.prototype.clearLayouts = function() {
this.data.clearItemLayouts();
}, r.createTree = function(e, t, n) {
var a = new r(t), i = [], o = 1;
s(e);
function s(h, f) {
var c = h.value;
o = Math.max(o, z(c) ? c.length : 1), i.push(h);
var v = new fF(oe(h.name, ""), a);
f ? cF(v, f) : a.root = v, a._nodes.push(v);
var p = h.children;
if (p)
for (var d = 0; d < p.length; d++)
s(p[d], v);
}
a.root.updateDepthAndHeight(0);
var l = $l(i, {
coordDimensions: ["value"],
dimensionsCount: o
}).dimensions, u = new Ne(l, t);
return u.initData(i), n && n(u), f2({
mainData: u,
struct: a,
structAttr: "tree"
}), a.update(), a;
}, r;
}()
);
function cF(r, e) {
var t = e.children;
r.parentNode !== e && (t.push(r), r.parentNode = e);
}
function Tl(r, e, t) {
if (r && pt(e, r.type) >= 0) {
var n = t.getData().tree.root, a = r.targetNode;
if (U(a) && (a = n.getNodeById(a)), a && n.contains(a))
return {
node: a
};
var i = r.targetNodeId;
if (i != null && (a = n.getNodeById(i)))
return {
node: a
};
}
}
function v2(r) {
for (var e = []; r; )
r = r.parentNode, r && e.push(r);
return e.reverse();
}
function vm(r, e) {
var t = v2(r);
return pt(t, e) >= 0;
}
function pc(r, e) {
for (var t = []; r; ) {
var n = r.dataIndex;
t.push({
name: r.name,
dataIndex: n,
value: e.getRawValue(n)
}), r = r.parentNode;
}
return t.reverse(), t;
}
var vF = (
/** @class */
function(r) {
O(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t.hasSymbolVisual = !0, t.ignoreStyleOnData = !0, t;
}
return e.prototype.getInitialData = function(t) {
var n = {
name: t.name,
children: t.data
}, a = t.leaves || {}, i = new It(a, this, this.ecModel), o = cm.createTree(n, this, s);
function s(f) {
f.wrapMethod("getItemModel", function(c, v) {
var p = o.getNodeByDataIndex(v);
return p && p.children.length && p.isExpand || (c.parentModel = i), c;
});
}
var l = 0;
o.eachNode("preorder", function(f) {
f.depth > l && (l = f.depth);
});
var u = t.expandAndCollapse, h = u && t.initialTreeDepth >= 0 ? t.initialTreeDepth : l;
return o.root.eachNode("preorder", function(f) {
var c = f.hostTree.data.getRawDataItem(f.dataIndex);
f.isExpand = c && c.collapsed != null ? !c.collapsed : f.depth <= h;
}), o.data;
}, e.prototype.getOrient = function() {
var t = this.get("orient");
return t === "horizontal" ? t = "LR" : t === "vertical" && (t = "TB"), t;
}, e.prototype.setZoom = function(t) {
this.option.zoom = t;
}, e.prototype.setCenter = function(t) {
this.option.center = t;
}, e.prototype.formatTooltip = function(t, n, a) {
for (var i = this.getData().tree, o = i.root.children[0], s = i.getNodeByDataIndex(t), l = s.getValue(), u = s.name; s && s !== o; )
u = s.parentNode.name + "." + u, s = s.parentNode;
return pe("nameValue", {
name: u,
value: l,
noValue: isNaN(l) || l == null
});
}, e.prototype.getDataParams = function(t) {
var n = r.prototype.getDataParams.apply(this, arguments), a = this.getData().tree.getNodeByDataIndex(t);
return n.treeAncestors = pc(a, this), n.collapsed = !a.isExpand, n;
}, e.type = "series.tree", e.layoutMode = "box", e.defaultOption = {
// zlevel: 0,
z: 2,
coordinateSystem: "view",
// the position of the whole view
left: "12%",
top: "12%",
right: "12%",
bottom: "12%",
// the layout of the tree, two value can be selected, 'orthogonal' or 'radial'
layout: "orthogonal",
// value can be 'polyline'
edgeShape: "curve",
edgeForkPosition: "50%",
// true | false | 'move' | 'scale', see module:component/helper/RoamController.
roam: !1,
// Symbol size scale ratio in roam
nodeScaleRatio: 0.4,
// Default on center of graph
center: null,
zoom: 1,
orient: "LR",
symbol: "emptyCircle",
symbolSize: 7,
expandAndCollapse: !0,
initialTreeDepth: 2,
lineStyle: {
color: "#ccc",
width: 1.5,
curveness: 0.5
},
itemStyle: {
color: "lightsteelblue",
// borderColor: '#c23531',
borderWidth: 1.5
},
label: {
show: !0
},
animationEasing: "linear",
animationDuration: 700,
animationDurationUpdate: 500
}, e;
}(Ft)
);
function pF(r, e, t) {
for (var n = [r], a = [], i; i = n.pop(); )
if (a.push(i), i.isExpand) {
var o = i.children;
if (o.length)
for (var s = 0; s < o.length; s++)
n.push(o[s]);
}
for (; i = a.pop(); )
e(i, t);
}
function bs(r, e) {
for (var t = [r], n; n = t.pop(); )
if (e(n), n.isExpand) {
var a = n.children;
if (a.length)
for (var i = a.length - 1; i >= 0; i--)
t.push(a[i]);
}
}
function dF(r, e) {
r.eachSeriesByType("tree", function(t) {
gF(t, e);
});
}
function gF(r, e) {
var t = qG(r, e);
r.layoutInfo = t;
var n = r.get("layout"), a = 0, i = 0, o = null;
n === "radial" ? (a = 2 * Math.PI, i = Math.min(t.height, t.width) / 2, o = px(function(_, S) {
return (_.parentNode === S.parentNode ? 1 : 2) / _.depth;
})) : (a = t.width, i = t.height, o = px());
var s = r.getData().tree.root, l = s.children[0];
if (l) {
YG(s), pF(l, ZG, o), s.hierNode.modifier = -l.hierNode.prelim, bs(l, XG);
var u = l, h = l, f = l;
bs(l, function(_) {
var S = _.getLayout().x;
S < u.getLayout().x && (u = _), S > h.getLayout().x && (h = _), _.depth > f.depth && (f = _);
});
var c = u === h ? 1 : o(u, h) / 2, v = c - u.getLayout().x, p = 0, d = 0, g = 0, y = 0;
if (n === "radial")
p = a / (h.getLayout().x + c + v), d = i / (f.depth - 1 || 1), bs(l, function(_) {
g = (_.getLayout().x + v) * p, y = (_.depth - 1) * d;
var S = zs(g, y);
_.setLayout({
x: S.x,
y: S.y,
rawX: g,
rawY: y
}, !0);
});
else {
var m = r.getOrient();
m === "RL" || m === "LR" ? (d = i / (h.getLayout().x + c + v), p = a / (f.depth - 1 || 1), bs(l, function(_) {
y = (_.getLayout().x + v) * d, g = m === "LR" ? (_.depth - 1) * p : a - (_.depth - 1) * p, _.setLayout({
x: g,
y
}, !0);
})) : (m === "TB" || m === "BT") && (p = a / (h.getLayout().x + c + v), d = i / (f.depth - 1 || 1), bs(l, function(_) {
g = (_.getLayout().x + v) * p, y = m === "TB" ? (_.depth - 1) * d : i - (_.depth - 1) * d, _.setLayout({
x: g,
y
}, !0);
}));
}
}
}
function yF(r) {
r.eachSeriesByType("tree", function(e) {
var t = e.getData(), n = t.tree;
n.eachNode(function(a) {
var i = a.getModel(), o = i.getModel("itemStyle").getItemStyle(), s = t.ensureUniqueItemVisual(a.dataIndex, "style");
B(s, o);
});
});
}
function mF(r) {
r.registerAction({
type: "treeExpandAndCollapse",
event: "treeExpandAndCollapse",
update: "update"
}, function(e, t) {
t.eachComponent({
mainType: "series",
subType: "tree",
query: e
}, function(n) {
var a = e.dataIndex, i = n.getData().tree, o = i.getNodeByDataIndex(a);
o.isExpand = !o.isExpand;
});
}), r.registerAction({
type: "treeRoam",
event: "treeRoam",
// Here we set 'none' instead of 'update', because roam action
// just need to update the transform matrix without having to recalculate
// the layout. So don't need to go through the whole update process, such
// as 'dataPrcocess', 'coordSystemUpdate', 'layout' and so on.
update: "none"
}, function(e, t, n) {
t.eachComponent({
mainType: "series",
subType: "tree",
query: e
}, function(a) {
var i = a.coordinateSystem, o = hm(i, e, void 0, n);
a.setCenter && a.setCenter(o.center), a.setZoom && a.setZoom(o.zoom);
});
});
}
function _F(r) {
r.registerChartView(nF), r.registerSeriesModel(vF), r.registerLayout(dF), r.registerVisual(yF), mF(r);
}
var _x = ["treemapZoomToNode", "treemapRender", "treemapMove"];
function SF(r) {
for (var e = 0; e < _x.length; e++)
r.registerAction({
type: _x[e],
update: "updateView"
}, Jt);
r.registerAction({
type: "treemapRootToNode",
update: "updateView"
}, function(t, n) {
n.eachComponent({
mainType: "series",
subType: "treemap",
query: t
}, a);
function a(i, o) {
var s = ["treemapZoomToNode", "treemapRootToNode"], l = Tl(t, s, i);
if (l) {
var u = i.getViewRoot();
u && (t.direction = vm(u, l.node) ? "rollUp" : "drillDown"), i.resetViewRoot(l.node);
}
}
});
}
function p2(r) {
var e = r.getData(), t = e.tree, n = {};
t.eachNode(function(a) {
for (var i = a; i && i.depth > 1; )
i = i.parentNode;
var o = Od(r.ecModel, i.name || i.dataIndex + "", n);
a.setVisual("decal", o);
});
}
var xF = (
/** @class */
function(r) {
O(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t.type = e.type, t.preventUsingHoverLayer = !0, t;
}
return e.prototype.getInitialData = function(t, n) {
var a = {
name: t.name,
children: t.data
};
d2(a);
var i = t.levels || [], o = this.designatedVisualItemStyle = {}, s = new It({
itemStyle: o
}, this, n);
i = t.levels = bF(i, n);
var l = G(i || [], function(f) {
return new It(f, s, n);
}, this), u = cm.createTree(a, this, h);
function h(f) {
f.wrapMethod("getItemModel", function(c, v) {
var p = u.getNodeByDataIndex(v), d = p ? l[p.depth] : null;
return c.parentModel = d || s, c;
});
}
return u.data;
}, e.prototype.optionUpdated = function() {
this.resetViewRoot();
}, e.prototype.formatTooltip = function(t, n, a) {
var i = this.getData(), o = this.getRawValue(t), s = i.getName(t);
return pe("nameValue", {
name: s,
value: o
});
}, e.prototype.getDataParams = function(t) {
var n = r.prototype.getDataParams.apply(this, arguments), a = this.getData().tree.getNodeByDataIndex(t);
return n.treeAncestors = pc(a, this), n.treePathInfo = n.treeAncestors, n;
}, e.prototype.setLayoutInfo = function(t) {
this.layoutInfo = this.layoutInfo || {}, B(this.layoutInfo, t);
}, e.prototype.mapIdToIndex = function(t) {
var n = this._idIndexMap;
n || (n = this._idIndexMap = X(), this._idIndexMapCount = 0);
var a = n.get(t);
return a == null && n.set(t, a = this._idIndexMapCount++), a;
}, e.prototype.getViewRoot = function() {
return this._viewRoot;
}, e.prototype.resetViewRoot = function(t) {
t ? this._viewRoot = t : t = this._viewRoot;
var n = this.getRawData().tree.root;
(!t || t !== n && !n.contains(t)) && (this._viewRoot = n);
}, e.prototype.enableAriaDecal = function() {
p2(this);
}, e.type = "series.treemap", e.layoutMode = "box", e.defaultOption = {
// Disable progressive rendering
progressive: 0,
// size: ['80%', '80%'], // deprecated, compatible with ec2.
left: "center",
top: "middle",
width: "80%",
height: "80%",
sort: !0,
clipWindow: "origin",
squareRatio: 0.5 * (1 + Math.sqrt(5)),
leafDepth: null,
drillDownIcon: "▶",
// to align specialized icon. ▷▶❒❐▼✚
zoomToNodeRatio: 0.32 * 0.32,
scaleLimit: null,
roam: !0,
nodeClick: "zoomToNode",
animation: !0,
animationDurationUpdate: 900,
animationEasing: "quinticInOut",
breadcrumb: {
show: !0,
height: 22,
left: "center",
top: "bottom",
// right
// bottom
emptyItemWidth: 25,
itemStyle: {
color: "rgba(0,0,0,0.7)",
textStyle: {
color: "#fff"
}
},
emphasis: {
itemStyle: {
color: "rgba(0,0,0,0.9)"
// '#5793f3',
}
}
},
label: {
show: !0,
// Do not use textDistance, for ellipsis rect just the same as treemap node rect.
distance: 0,
padding: 5,
position: "inside",
// formatter: null,
color: "#fff",
overflow: "truncate"
// align
// verticalAlign
},
upperLabel: {
show: !1,
position: [0, "50%"],
height: 20,
// formatter: null,
// color: '#fff',
overflow: "truncate",
// align: null,
verticalAlign: "middle"
},
itemStyle: {
color: null,
colorAlpha: null,
colorSaturation: null,
borderWidth: 0,
gapWidth: 0,
borderColor: "#fff",
borderColorSaturation: null
// If specified, borderColor will be ineffective, and the
// border color is evaluated by color of current node and
// borderColorSaturation.
},
emphasis: {
upperLabel: {
show: !0,
position: [0, "50%"],
overflow: "truncate",
verticalAlign: "middle"
}
},
visualDimension: 0,
visualMin: null,
visualMax: null,
color: [],
// level[n].color (if necessary).
// + Specify color list of each level. level[0].color would be global
// color list if not specified. (see method `setDefault`).
// + But set as a empty array to forbid fetch color from global palette
// when using nodeModel.get('color'), otherwise nodes on deep level
// will always has color palette set and are not able to inherit color
// from parent node.
// + TreemapSeries.color can not be set as 'none', otherwise effect
// legend color fetching (see seriesColor.js).
colorAlpha: null,
colorSaturation: null,
colorMappingBy: "index",
visibleMin: 10,
// be rendered. Only works when sort is 'asc' or 'desc'.
childrenVisibleMin: null,
// grandchildren will not show.
// Why grandchildren? If not grandchildren but children,
// some siblings show children and some not,
// the appearance may be mess and not consistent,
levels: []
// Each item: {
// visibleMin, itemStyle, visualDimension, label
// }
}, e;
}(Ft)
);
function d2(r) {
var e = 0;
A(r.children, function(n) {
d2(n);
var a = n.value;
z(a) && (a = a[0]), e += a;
});
var t = r.value;
z(t) && (t = t[0]), (t == null || isNaN(t)) && (t = e), t < 0 && (t = 0), z(r.value) ? r.value[0] = t : r.value = t;
}
function bF(r, e) {
var t = Pt(e.get("color")), n = Pt(e.get(["aria", "decal", "decals"]));
if (t) {
r = r || [];
var a, i;
A(r, function(s) {
var l = new It(s), u = l.get("color"), h = l.get("decal");
(l.get(["itemStyle", "color"]) || u && u !== "none") && (a = !0), (l.get(["itemStyle", "decal"]) || h && h !== "none") && (i = !0);
});
var o = r[0] || (r[0] = {});
return a || (o.color = t.slice()), !i && n && (o.decal = n.slice()), r;
}
}
var wF = 8, Sx = 8, Kv = 5, TF = (
/** @class */
function() {
function r(e) {
this.group = new at(), e.add(this.group);
}
return r.prototype.render = function(e, t, n, a) {
var i = e.getModel("breadcrumb"), o = this.group;
if (o.removeAll(), !(!i.get("show") || !n)) {
var s = i.getModel("itemStyle"), l = i.getModel("emphasis"), u = s.getModel("textStyle"), h = l.getModel(["itemStyle", "textStyle"]), f = {
pos: {
left: i.get("left"),
right: i.get("right"),
top: i.get("top"),
bottom: i.get("bottom")
},
box: {
width: t.getWidth(),
height: t.getHeight()
},
emptyItemWidth: i.get("emptyItemWidth"),
totalWidth: 0,
renderList: []
};
this._prepare(n, f, u), this._renderContent(e, f, s, l, u, h, a), ec(o, f.pos, f.box);
}
}, r.prototype._prepare = function(e, t, n) {
for (var a = e; a; a = a.parentNode) {
var i = oe(a.getModel().get("name"), ""), o = n.getTextRect(i), s = Math.max(o.width + wF * 2, t.emptyItemWidth);
t.totalWidth += s + Sx, t.renderList.push({
node: a,
text: i,
width: s
});
}
}, r.prototype._renderContent = function(e, t, n, a, i, o, s) {
for (var l = 0, u = t.emptyItemWidth, h = e.get(["breadcrumb", "height"]), f = IN(t.pos, t.box), c = t.totalWidth, v = t.renderList, p = a.getModel("itemStyle").getItemStyle(), d = v.length - 1; d >= 0; d--) {
var g = v[d], y = g.node, m = g.width, _ = g.text;
c > f.width && (c -= m - u, m = u, _ = null);
var S = new Fe({
shape: {
points: CF(l, 0, m, h, d === v.length - 1, d === 0)
},
style: et(n.getItemStyle(), {
lineJoin: "bevel"
}),
textContent: new wt({
style: Gt(i, {
text: _
})
}),
textConfig: {
position: "inside"
},
z2: zo * 1e4,
onclick: ut(s, y)
});
S.disableLabelAnimation = !0, S.getTextContent().ensureState("emphasis").style = Gt(o, {
text: _
}), S.ensureState("emphasis").style = p, Xt(S, a.get("focus"), a.get("blurScope"), a.get("disabled")), this.group.add(S), DF(S, e, y), l += m + Sx;
}
}, r.prototype.remove = function() {
this.group.removeAll();
}, r;
}()
);
function CF(r, e, t, n, a, i) {
var o = [[a ? r : r - Kv, e], [r + t, e], [r + t, e + n], [a ? r : r - Kv, e + n]];
return !i && o.splice(2, 0, [r + t + Kv, e + n / 2]), !a && o.push([r, e + n / 2]), o;
}
function DF(r, e, t) {
it(r).eventData = {
componentType: "series",
componentSubType: "treemap",
componentIndex: e.componentIndex,
seriesIndex: e.seriesIndex,
seriesName: e.name,
seriesType: "treemap",
selfType: "breadcrumb",
nodeData: {
dataIndex: t && t.dataIndex,
name: t && t.name
},
treePathInfo: t && pc(t, e)
};
}
var AF = (
/** @class */
function() {
function r() {
this._storage = [], this._elExistsMap = {};
}
return r.prototype.add = function(e, t, n, a, i) {
return this._elExistsMap[e.id] ? !1 : (this._elExistsMap[e.id] = !0, this._storage.push({
el: e,
target: t,
duration: n,
delay: a,
easing: i
}), !0);
}, r.prototype.finished = function(e) {
return this._finishedCallback = e, this;
}, r.prototype.start = function() {
for (var e = this, t = this._storage.length, n = function() {
t--, t <= 0 && (e._storage.length = 0, e._elExistsMap = {}, e._finishedCallback && e._finishedCallback());
}, a = 0, i = this._storage.length; a < i; a++) {
var o = this._storage[a];
o.el.animateTo(o.target, {
duration: o.duration,
delay: o.delay,
easing: o.easing,
setToFinal: !0,
done: n,
aborted: n
});
}
return this;
}, r;
}()
);
function MF() {
return new AF();
}
var ug = at, xx = xt, bx = 3, Tx = "label", Cx = "upperLabel", IF = zo * 10, LF = zo * 2, EF = zo * 3, Za = wi([
["fill", "color"],
// `borderColor` and `borderWidth` has been occupied,
// so use `stroke` to indicate the stroke of the rect.
["stroke", "strokeColor"],
["lineWidth", "strokeWidth"],
["shadowBlur"],
["shadowOffsetX"],
["shadowOffsetY"],
["shadowColor"]
// Option decal is in `DecalObject` but style.decal is in `PatternObject`.
// So do not transfer decal directly.
]), Dx = function(r) {
var e = Za(r);
return e.stroke = e.fill = e.lineWidth = null, e;
}, uf = bt(), PF = (
/** @class */
function(r) {
O(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t.type = e.type, t._state = "ready", t._storage = ws(), t;
}
return e.prototype.render = function(t, n, a, i) {
var o = n.findComponents({
mainType: "series",
subType: "treemap",
query: i
});
if (!(pt(o, t) < 0)) {
this.seriesModel = t, this.api = a, this.ecModel = n;
var s = ["treemapZoomToNode", "treemapRootToNode"], l = Tl(i, s, t), u = i && i.type, h = t.layoutInfo, f = !this._oldTree, c = this._storage, v = u === "treemapRootToNode" && l && c ? {
rootNodeGroup: c.nodeGroup[l.node.getRawIndex()],
direction: i.direction
} : null, p = this._giveContainerGroup(h), d = t.get("animation"), g = this._doRender(p, t, v);
d && !f && (!u || u === "treemapZoomToNode" || u === "treemapRootToNode") ? this._doAnimation(p, g, t, v) : g.renderFinally(), this._resetController(a), this._renderBreadcrumb(t, a, l);
}
}, e.prototype._giveContainerGroup = function(t) {
var n = this._containerGroup;
return n || (n = this._containerGroup = new ug(), this._initEvents(n), this.group.add(n)), n.x = t.x, n.y = t.y, n;
}, e.prototype._doRender = function(t, n, a) {
var i = n.getData().tree, o = this._oldTree, s = ws(), l = ws(), u = this._storage, h = [];
function f(m, _, S, x) {
return kF(n, l, u, a, s, h, m, _, S, x);
}
d(i.root ? [i.root] : [], o && o.root ? [o.root] : [], t, i === o || !o, 0);
var c = g(u);
if (this._oldTree = i, this._storage = l, this._controllerHost) {
var v = this.seriesModel.layoutInfo, p = i.root.getLayout();
p.width === v.width && p.height === v.height && (this._controllerHost.zoom = 1);
}
return {
lastsForAnimation: s,
willDeleteEls: c,
renderFinally: y
};
function d(m, _, S, x, b) {
x ? (_ = m, A(m, function(C, D) {
!C.isRemoved() && T(D, D);
})) : new Ln(_, m, w, w).add(T).update(T).remove(ut(T, null)).execute();
function w(C) {
return C.getId();
}
function T(C, D) {
var M = C != null ? m[C] : null, I = D != null ? _[D] : null, L = f(M, I, S, b);
L && d(M && M.viewChildren || [], I && I.viewChildren || [], L, x, b + 1);
}
}
function g(m) {
var _ = ws();
return m && A(m, function(S, x) {
var b = _[x];
A(S, function(w) {
w && (b.push(w), uf(w).willDelete = !0);
});
}), _;
}
function y() {
A(c, function(m) {
A(m, function(_) {
_.parent && _.parent.remove(_);
});
}), A(h, function(m) {
m.invisible = !0, m.dirty();
});
}
}, e.prototype._doAnimation = function(t, n, a, i) {
var o = a.get("animationDurationUpdate"), s = a.get("animationEasing"), l = (K(o) ? 0 : o) || 0, u = (K(s) ? null : s) || "cubicOut", h = MF();
A(n.willDeleteEls, function(f, c) {
A(f, function(v, p) {
if (!v.invisible) {
var d = v.parent, g, y = uf(d);
if (i && i.direction === "drillDown")
g = d === i.rootNodeGroup ? {
shape: {
x: 0,
y: 0,
width: y.nodeWidth,
height: y.nodeHeight
},
style: {
opacity: 0
}
} : {
style: {
opacity: 0
}
};
else {
var m = 0, _ = 0;
y.willDelete || (m = y.nodeWidth / 2, _ = y.nodeHeight / 2), g = c === "nodeGroup" ? {
x: m,
y: _,
style: {
opacity: 0
}
} : {
shape: {
x: m,
y: _,
width: 0,
height: 0
},
style: {
opacity: 0
}
};
}
g && h.add(v, g, l, 0, u);
}
});
}), A(this._storage, function(f, c) {
A(f, function(v, p) {
var d = n.lastsForAnimation[c][p], g = {};
d && (v instanceof at ? d.oldX != null && (g.x = v.x, g.y = v.y, v.x = d.oldX, v.y = d.oldY) : (d.oldShape && (g.shape = B({}, v.shape), v.setShape(d.oldShape)), d.fadein ? (v.setStyle("opacity", 0), g.style = {
opacity: 1
}) : v.style.opacity !== 1 && (g.style = {
opacity: 1
})), h.add(v, g, l, 0, u));
});
}, this), this._state = "animating", h.finished(Y(function() {
this._state = "ready", n.renderFinally();
}, this)).start();
}, e.prototype._resetController = function(t) {
var n = this._controller, a = this._controllerHost;
a || (this._controllerHost = {
target: this.group
}, a = this._controllerHost), n || (n = this._controller = new Ql(t.getZr()), n.enable(this.seriesModel.get("roam")), a.zoomLimit = this.seriesModel.get("scaleLimit"), a.zoom = this.seriesModel.get("zoom"), n.on("pan", Y(this._onPan, this)), n.on("zoom", Y(this._onZoom, this)));
var i = new ct(0, 0, t.getWidth(), t.getHeight());
n.setPointerChecker(function(o, s, l) {
return i.contain(s, l);
});
}, e.prototype._clearController = function() {
var t = this._controller;
this._controllerHost = null, t && (t.dispose(), t = null);
}, e.prototype._onPan = function(t) {
if (this._state !== "animating" && (Math.abs(t.dx) > bx || Math.abs(t.dy) > bx)) {
var n = this.seriesModel.getData().tree.root;
if (!n)
return;
var a = n.getLayout();
if (!a)
return;
this.api.dispatchAction({
type: "treemapMove",
from: this.uid,
seriesId: this.seriesModel.id,
rootRect: {
x: a.x + t.dx,
y: a.y + t.dy,
width: a.width,
height: a.height
}
});
}
}, e.prototype._onZoom = function(t) {
var n = t.originX, a = t.originY, i = t.scale;
if (this._state !== "animating") {
var o = this.seriesModel.getData().tree.root;
if (!o)
return;
var s = o.getLayout();
if (!s)
return;
var l = new ct(s.x, s.y, s.width, s.height), u = null, h = this._controllerHost;
u = h.zoomLimit;
var f = h.zoom = h.zoom || 1;
if (f *= i, u) {
var c = u.min || 0, v = u.max || 1 / 0;
f = Math.max(Math.min(v, f), c);
}
var p = f / h.zoom;
h.zoom = f;
var d = this.seriesModel.layoutInfo;
n -= d.x, a -= d.y;
var g = tr();
nn(g, g, [-n, -a]), ny(g, g, [p, p]), nn(g, g, [n, a]), l.applyTransform(g), this.api.dispatchAction({
type: "treemapRender",
from: this.uid,
seriesId: this.seriesModel.id,
rootRect: {
x: l.x,
y: l.y,
width: l.width,
height: l.height
}
});
}
}, e.prototype._initEvents = function(t) {
var n = this;
t.on("click", function(a) {
if (n._state === "ready") {
var i = n.seriesModel.get("nodeClick", !0);
if (i) {
var o = n.findTarget(a.offsetX, a.offsetY);
if (o) {
var s = o.node;
if (s.getLayout().isLeafRoot)
n._rootToNode(o);
else if (i === "zoomToNode")
n._zoomToNode(o);
else if (i === "link") {
var l = s.hostTree.data.getItemModel(s.dataIndex), u = l.get("link", !0), h = l.get("target", !0) || "blank";
u && $h(u, h);
}
}
}
}
}, this);
}, e.prototype._renderBreadcrumb = function(t, n, a) {
var i = this;
a || (a = t.get("leafDepth", !0) != null ? {
node: t.getViewRoot()
} : this.findTarget(n.getWidth() / 2, n.getHeight() / 2), a || (a = {
node: t.getData().tree.root
})), (this._breadcrumb || (this._breadcrumb = new TF(this.group))).render(t, n, a.node, function(o) {
i._state !== "animating" && (vm(t.getViewRoot(), o) ? i._rootToNode({
node: o
}) : i._zoomToNode({
node: o
}));
});
}, e.prototype.remove = function() {
this._clearController(), this._containerGroup && this._containerGroup.removeAll(), this._storage = ws(), this._state = "ready", this._breadcrumb && this._breadcrumb.remove();
}, e.prototype.dispose = function() {
this._clearController();
}, e.prototype._zoomToNode = function(t) {
this.api.dispatchAction({
type: "treemapZoomToNode",
from: this.uid,
seriesId: this.seriesModel.id,
targetNode: t.node
});
}, e.prototype._rootToNode = function(t) {
this.api.dispatchAction({
type: "treemapRootToNode",
from: this.uid,
seriesId: this.seriesModel.id,
targetNode: t.node
});
}, e.prototype.findTarget = function(t, n) {
var a, i = this.seriesModel.getViewRoot();
return i.eachNode({
attr: "viewChildren",
order: "preorder"
}, function(o) {
var s = this._storage.background[o.getRawIndex()];
if (s) {
var l = s.transformCoordToLocal(t, n), u = s.shape;
if (u.x <= l[0] && l[0] <= u.x + u.width && u.y <= l[1] && l[1] <= u.y + u.height)
a = {
node: o,
offsetX: l[0],
offsetY: l[1]
};
else
return !1;
}
}, this), a;
}, e.type = "treemap", e;
}(kt)
);
function ws() {
return {
nodeGroup: [],
background: [],
content: []
};
}
function kF(r, e, t, n, a, i, o, s, l, u) {
if (!o)
return;
var h = o.getLayout(), f = r.getData(), c = o.getModel();
if (f.setItemGraphicEl(o.dataIndex, null), !h || !h.isInView)
return;
var v = h.width, p = h.height, d = h.borderWidth, g = h.invisible, y = o.getRawIndex(), m = s && s.getRawIndex(), _ = o.viewChildren, S = h.upperHeight, x = _ && _.length, b = c.getModel("itemStyle"), w = c.getModel(["emphasis", "itemStyle"]), T = c.getModel(["blur", "itemStyle"]), C = c.getModel(["select", "itemStyle"]), D = b.get("borderRadius") || 0, M = st("nodeGroup", ug);
if (!M)
return;
if (l.add(M), M.x = h.x || 0, M.y = h.y || 0, M.markRedraw(), uf(M).nodeWidth = v, uf(M).nodeHeight = p, h.isAboveViewRoot)
return M;
var I = st("background", xx, u, LF);
I && F(M, I, x && h.upperLabelHeight);
var L = c.getModel("emphasis"), E = L.get("focus"), P = L.get("blurScope"), k = L.get("disabled"), N = E === "ancestor" ? o.getAncestorsIndices() : E === "descendant" ? o.getDescendantIndices() : E;
if (x)
ca(M) && ni(M, !1), I && (ni(I, !k), f.setItemGraphicEl(o.dataIndex, I), Ad(I, N, P));
else {
var R = st("content", xx, u, EF);
R && H(M, R), I.disableMorphing = !0, I && ca(I) && ni(I, !1), ni(M, !k), f.setItemGraphicEl(o.dataIndex, M);
var V = c.getShallow("cursor");
V && R.attr("cursor", V), Ad(M, N, P);
}
return M;
function F(vt, rt, dt) {
var q = it(rt);
if (q.dataIndex = o.dataIndex, q.seriesIndex = r.seriesIndex, rt.setShape({
x: 0,
y: 0,
width: v,
height: p,
r: D
}), g)
$(rt);
else {
rt.invisible = !1;
var lt = o.getVisual("style"), Vt = lt.stroke, Lt = Dx(b);
Lt.fill = Vt;
var Rt = Za(w);
Rt.fill = w.get("borderColor");
var Ut = Za(T);
Ut.fill = T.get("borderColor");
var le = Za(C);
if (le.fill = C.get("borderColor"), dt) {
var Ke = v - 2 * d;
j(
// PENDING: convert ZRColor to ColorString for text.
rt,
Vt,
lt.opacity,
{
x: d,
y: 0,
width: Ke,
height: S
}
);
} else
rt.removeTextContent();
rt.setStyle(Lt), rt.ensureState("emphasis").style = Rt, rt.ensureState("blur").style = Ut, rt.ensureState("select").style = le, Ti(rt);
}
vt.add(rt);
}
function H(vt, rt) {
var dt = it(rt);
dt.dataIndex = o.dataIndex, dt.seriesIndex = r.seriesIndex;
var q = Math.max(v - 2 * d, 0), lt = Math.max(p - 2 * d, 0);
if (rt.culling = !0, rt.setShape({
x: d,
y: d,
width: q,
height: lt,
r: D
}), g)
$(rt);
else {
rt.invisible = !1;
var Vt = o.getVisual("style"), Lt = Vt.fill, Rt = Dx(b);
Rt.fill = Lt, Rt.decal = Vt.decal;
var Ut = Za(w), le = Za(T), Ke = Za(C);
j(rt, Lt, Vt.opacity, null), rt.setStyle(Rt), rt.ensureState("emphasis").style = Ut, rt.ensureState("blur").style = le, rt.ensureState("select").style = Ke, Ti(rt);
}
vt.add(rt);
}
function $(vt) {
!vt.invisible && i.push(vt);
}
function j(vt, rt, dt, q) {
var lt = c.getModel(q ? Cx : Tx), Vt = oe(c.get("name"), null), Lt = lt.getShallow("show");
xe(vt, ve(c, q ? Cx : Tx), {
defaultText: Lt ? Vt : null,
inheritColor: rt,
defaultOpacity: dt,
labelFetcher: r,
labelDataIndex: o.dataIndex
});
var Rt = vt.getTextContent();
if (Rt) {
var Ut = Rt.style, le = ty(Ut.padding || 0);
q && (vt.setTextConfig({
layoutRect: q
}), Rt.disableLabelLayout = !0), Rt.beforeUpdate = function() {
var We = Math.max((q ? q.width : vt.shape.width) - le[1] - le[3], 0), Sa = Math.max((q ? q.height : vt.shape.height) - le[0] - le[2], 0);
(Ut.width !== We || Ut.height !== Sa) && Rt.setStyle({
width: We,
height: Sa
});
}, Ut.truncateMinChar = 2, Ut.lineOverflow = "truncate", Q(Ut, q, h);
var Ke = Rt.getState("emphasis");
Q(Ke ? Ke.style : null, q, h);
}
}
function Q(vt, rt, dt) {
var q = vt ? vt.text : null;
if (!rt && dt.isLeafRoot && q != null) {
var lt = r.get("drillDownIcon", !0);
vt.text = lt ? lt + " " + q : q;
}
}
function st(vt, rt, dt, q) {
var lt = m != null && t[vt][m], Vt = a[vt];
return lt ? (t[vt][m] = null, Et(Vt, lt)) : g || (lt = new rt(), lt instanceof Sr && (lt.z2 = RF(dt, q)), qt(Vt, lt)), e[vt][y] = lt;
}
function Et(vt, rt) {
var dt = vt[y] = {};
rt instanceof ug ? (dt.oldX = rt.x, dt.oldY = rt.y) : dt.oldShape = B({}, rt.shape);
}
function qt(vt, rt) {
var dt = vt[y] = {}, q = o.parentNode, lt = rt instanceof at;
if (q && (!n || n.direction === "drillDown")) {
var Vt = 0, Lt = 0, Rt = a.background[q.getRawIndex()];
!n && Rt && Rt.oldShape && (Vt = Rt.oldShape.width, Lt = Rt.oldShape.height), lt ? (dt.oldX = 0, dt.oldY = Lt) : dt.oldShape = {
x: Vt,
y: Lt,
width: 0,
height: 0
};
}
dt.fadein = !lt;
}
}
function RF(r, e) {
return r * IF + e;
}
var Cl = A, NF = J, hf = -1, ce = (
/** @class */
function() {
function r(e) {
var t = e.mappingMethod, n = e.type, a = this.option = nt(e);
this.type = n, this.mappingMethod = t, this._normalizeData = BF[t];
var i = r.visualHandlers[n];
this.applyVisual = i.applyVisual, this.getColorMapper = i.getColorMapper, this._normalizedToVisual = i._normalizedToVisual[t], t === "piecewise" ? (jv(a), OF(a)) : t === "category" ? a.categories ? VF(a) : jv(a, !0) : (tt(t !== "linear" || a.dataExtent), jv(a));
}
return r.prototype.mapValueToVisual = function(e) {
var t = this._normalizeData(e);
return this._normalizedToVisual(t, e);
}, r.prototype.getNormalizer = function() {
return Y(this._normalizeData, this);
}, r.listVisualTypes = function() {
return St(r.visualHandlers);
}, r.isValidType = function(e) {
return r.visualHandlers.hasOwnProperty(e);
}, r.eachVisual = function(e, t, n) {
J(e) ? A(e, t, n) : t.call(n, e);
}, r.mapVisual = function(e, t, n) {
var a, i = z(e) ? [] : J(e) ? {} : (a = !0, null);
return r.eachVisual(e, function(o, s) {
var l = t.call(n, o, s);
a ? i = l : i[s] = l;
}), i;
}, r.retrieveVisuals = function(e) {
var t = {}, n;
return e && Cl(r.visualHandlers, function(a, i) {
e.hasOwnProperty(i) && (t[i] = e[i], n = !0);
}), n ? t : null;
}, r.prepareVisualTypes = function(e) {
if (z(e))
e = e.slice();
else if (NF(e)) {
var t = [];
Cl(e, function(n, a) {
t.push(a);
}), e = t;
} else
return [];
return e.sort(function(n, a) {
return a === "color" && n !== "color" && n.indexOf("color") === 0 ? 1 : -1;
}), e;
}, r.dependsOn = function(e, t) {
return t === "color" ? !!(e && e.indexOf(t) === 0) : e === t;
}, r.findPieceIndex = function(e, t, n) {
for (var a, i = 1 / 0, o = 0, s = t.length; o < s; o++) {
var l = t[o].value;
if (l != null) {
if (l === e || U(l) && l === e + "")
return o;
n && c(l, o);
}
}
for (var o = 0, s = t.length; o < s; o++) {
var u = t[o], h = u.interval, f = u.close;
if (h) {
if (h[0] === -1 / 0) {
if (Wu(f[1], e, h[1]))
return o;
} else if (h[1] === 1 / 0) {
if (Wu(f[0], h[0], e))
return o;
} else if (Wu(f[0], h[0], e) && Wu(f[1], e, h[1]))
return o;
n && c(h[0], o), n && c(h[1], o);
}
}
if (n)
return e === 1 / 0 ? t.length - 1 : e === -1 / 0 ? 0 : a;
function c(v, p) {
var d = Math.abs(v - e);
d < i && (i = d, a = p);
}
}, r.visualHandlers = {
color: {
applyVisual: Ts("color"),
getColorMapper: function() {
var e = this.option;
return Y(e.mappingMethod === "category" ? function(t, n) {
return !n && (t = this._normalizeData(t)), Gs.call(this, t);
} : function(t, n, a) {
var i = !!a;
return !n && (t = this._normalizeData(t)), a = Ic(t, e.parsedVisual, a), i ? a : bn(a, "rgba");
}, this);
},
_normalizedToVisual: {
linear: function(e) {
return bn(Ic(e, this.option.parsedVisual), "rgba");
},
category: Gs,
piecewise: function(e, t) {
var n = fg.call(this, t);
return n == null && (n = bn(Ic(e, this.option.parsedVisual), "rgba")), n;
},
fixed: Xa
}
},
colorHue: Hu(function(e, t) {
return Ys(e, t);
}),
colorSaturation: Hu(function(e, t) {
return Ys(e, null, t);
}),
colorLightness: Hu(function(e, t) {
return Ys(e, null, null, t);
}),
colorAlpha: Hu(function(e, t) {
return Ph(e, t);
}),
decal: {
applyVisual: Ts("decal"),
_normalizedToVisual: {
linear: null,
category: Gs,
piecewise: null,
fixed: null
}
},
opacity: {
applyVisual: Ts("opacity"),
_normalizedToVisual: hg([0, 1])
},
liftZ: {
applyVisual: Ts("liftZ"),
_normalizedToVisual: {
linear: Xa,
category: Xa,
piecewise: Xa,
fixed: Xa
}
},
symbol: {
applyVisual: function(e, t, n) {
var a = this.mapValueToVisual(e);
n("symbol", a);
},
_normalizedToVisual: {
linear: Ax,
category: Gs,
piecewise: function(e, t) {
var n = fg.call(this, t);
return n == null && (n = Ax.call(this, e)), n;
},
fixed: Xa
}
},
symbolSize: {
applyVisual: Ts("symbolSize"),
_normalizedToVisual: hg([0, 1])
}
}, r;
}()
);
function OF(r) {
var e = r.pieceList;
r.hasSpecialVisual = !1, A(e, function(t, n) {
t.originIndex = n, t.visual != null && (r.hasSpecialVisual = !0);
});
}
function VF(r) {
var e = r.categories, t = r.categoryMap = {}, n = r.visual;
if (Cl(e, function(o, s) {
t[o] = s;
}), !z(n)) {
var a = [];
J(n) ? Cl(n, function(o, s) {
var l = t[s];
a[l ?? hf] = o;
}) : a[hf] = n, n = g2(r, a);
}
for (var i = e.length - 1; i >= 0; i--)
n[i] == null && (delete t[e[i]], e.pop());
}
function jv(r, e) {
var t = r.visual, n = [];
J(t) ? Cl(t, function(i) {
n.push(i);
}) : t != null && n.push(t);
var a = {
color: 1,
symbol: 1
};
!e && n.length === 1 && !a.hasOwnProperty(r.type) && (n[1] = n[0]), g2(r, n);
}
function Hu(r) {
return {
applyVisual: function(e, t, n) {
var a = this.mapValueToVisual(e);
n("color", r(t("color"), a));
},
_normalizedToVisual: hg([0, 1])
};
}
function Ax(r) {
var e = this.option.visual;
return e[Math.round(Mt(r, [0, 1], [0, e.length - 1], !0))] || {};
}
function Ts(r) {
return function(e, t, n) {
n(r, this.mapValueToVisual(e));
};
}
function Gs(r) {
var e = this.option.visual;
return e[this.option.loop && r !== hf ? r % e.length : r];
}
function Xa() {
return this.option.visual[0];
}
function hg(r) {
return {
linear: function(e) {
return Mt(e, r, this.option.visual, !0);
},
category: Gs,
piecewise: function(e, t) {
var n = fg.call(this, t);
return n == null && (n = Mt(e, r, this.option.visual, !0)), n;
},
fixed: Xa
};
}
function fg(r) {
var e = this.option, t = e.pieceList;
if (e.hasSpecialVisual) {
var n = ce.findPieceIndex(r, t), a = t[n];
if (a && a.visual)
return a.visual[this.type];
}
}
function g2(r, e) {
return r.visual = e, r.type === "color" && (r.parsedVisual = G(e, function(t) {
var n = er(t);
return !n && process.env.NODE_ENV !== "production" && Zt("'" + t + "' is an illegal color, fallback to '#000000'", !0), n || [0, 0, 0, 1];
})), e;
}
var BF = {
linear: function(r) {
return Mt(r, this.option.dataExtent, [0, 1], !0);
},
piecewise: function(r) {
var e = this.option.pieceList, t = ce.findPieceIndex(r, e, !0);
if (t != null)
return Mt(t, [0, e.length - 1], [0, 1], !0);
},
category: function(r) {
var e = this.option.categories ? this.option.categoryMap[r] : r;
return e ?? hf;
},
fixed: Jt
};
function Wu(r, e, t) {
return r ? e <= t : e < t;
}
var zF = "itemStyle", y2 = bt();
const GF = {
seriesType: "treemap",
reset: function(r) {
var e = r.getData().tree, t = e.root;
t.isRemoved() || m2(
t,
// Visual should calculate from tree root but not view root.
{},
r.getViewRoot().getAncestors(),
r
);
}
};
function m2(r, e, t, n) {
var a = r.getModel(), i = r.getLayout(), o = r.hostTree.data;
if (!(!i || i.invisible || !i.isInView)) {
var s = a.getModel(zF), l = FF(s, e, n), u = o.ensureUniqueItemVisual(r.dataIndex, "style"), h = s.get("borderColor"), f = s.get("borderColorSaturation"), c;
f != null && (c = Mx(l), h = HF(f, c)), u.stroke = h;
var v = r.viewChildren;
if (!v || !v.length)
c = Mx(l), u.fill = c;
else {
var p = WF(r, a, i, s, l, v);
A(v, function(d, g) {
if (d.depth >= t.length || d === t[d.depth]) {
var y = $F(a, l, d, g, p, n);
m2(d, y, t, n);
}
});
}
}
}
function FF(r, e, t) {
var n = B({}, e), a = t.designatedVisualItemStyle;
return A(["color", "colorAlpha", "colorSaturation"], function(i) {
a[i] = e[i];
var o = r.get(i);
a[i] = null, o != null && (n[i] = o);
}), n;
}
function Mx(r) {
var e = Qv(r, "color");
if (e) {
var t = Qv(r, "colorAlpha"), n = Qv(r, "colorSaturation");
return n && (e = Ys(e, null, null, n)), t && (e = Ph(e, t)), e;
}
}
function HF(r, e) {
return e != null ? Ys(e, null, null, r) : null;
}
function Qv(r, e) {
var t = r[e];
if (t != null && t !== "none")
return t;
}
function WF(r, e, t, n, a, i) {
if (!(!i || !i.length)) {
var o = Jv(e, "color") || a.color != null && a.color !== "none" && (Jv(e, "colorAlpha") || Jv(e, "colorSaturation"));
if (o) {
var s = e.get("visualMin"), l = e.get("visualMax"), u = t.dataExtent.slice();
s != null && s < u[0] && (u[0] = s), l != null && l > u[1] && (u[1] = l);
var h = e.get("colorMappingBy"), f = {
type: o.name,
dataExtent: u,
visual: o.range
};
f.type === "color" && (h === "index" || h === "id") ? (f.mappingMethod = "category", f.loop = !0) : f.mappingMethod = "linear";
var c = new ce(f);
return y2(c).drColorMappingBy = h, c;
}
}
}
function Jv(r, e) {
var t = r.get(e);
return z(t) && t.length ? {
name: e,
range: t
} : null;
}
function $F(r, e, t, n, a, i) {
var o = B({}, e);
if (a) {
var s = a.type, l = s === "color" && y2(a).drColorMappingBy, u = l === "index" ? n : l === "id" ? i.mapIdToIndex(t.getId()) : t.getValue(r.get("visualDimension"));
o[s] = a.mapValueToVisual(u);
}
return o;
}
var Dl = Math.max, ff = Math.min, Ix = re, pm = A, _2 = ["itemStyle", "borderWidth"], UF = ["itemStyle", "gapWidth"], YF = ["upperLabel", "show"], ZF = ["upperLabel", "height"];
const XF = {
seriesType: "treemap",
reset: function(r, e, t, n) {
var a = t.getWidth(), i = t.getHeight(), o = r.option, s = se(r.getBoxLayoutParams(), {
width: t.getWidth(),
height: t.getHeight()
}), l = o.size || [], u = W(Ix(s.width, l[0]), a), h = W(Ix(s.height, l[1]), i), f = n && n.type, c = ["treemapZoomToNode", "treemapRootToNode"], v = Tl(n, c, r), p = f === "treemapRender" || f === "treemapMove" ? n.rootRect : null, d = r.getViewRoot(), g = v2(d);
if (f !== "treemapMove") {
var y = f === "treemapZoomToNode" ? t4(r, v, d, u, h) : p ? [p.width, p.height] : [u, h], m = o.sort;
m && m !== "asc" && m !== "desc" && (m = "desc");
var _ = {
squareRatio: o.squareRatio,
sort: m,
leafDepth: o.leafDepth
};
d.hostTree.clearLayouts();
var S = {
x: 0,
y: 0,
width: y[0],
height: y[1],
area: y[0] * y[1]
};
d.setLayout(S), S2(d, _, !1, 0), S = d.getLayout(), pm(g, function(b, w) {
var T = (g[w + 1] || d).getValue();
b.setLayout(B({
dataExtent: [T, T],
borderWidth: 0,
upperHeight: 0
}, S));
});
}
var x = r.getData().tree.root;
x.setLayout(e4(s, p, v), !0), r.setLayoutInfo(s), x2(
x,
// Transform to base element coordinate system.
new ct(-s.x, -s.y, a, i),
g,
d,
0
);
}
};
function S2(r, e, t, n) {
var a, i;
if (!r.isRemoved()) {
var o = r.getLayout();
a = o.width, i = o.height;
var s = r.getModel(), l = s.get(_2), u = s.get(UF) / 2, h = b2(s), f = Math.max(l, h), c = l - u, v = f - u;
r.setLayout({
borderWidth: l,
upperHeight: f,
upperLabelHeight: h
}, !0), a = Dl(a - 2 * c, 0), i = Dl(i - c - v, 0);
var p = a * i, d = qF(r, s, p, e, t, n);
if (d.length) {
var g = {
x: c,
y: v,
width: a,
height: i
}, y = ff(a, i), m = 1 / 0, _ = [];
_.area = 0;
for (var S = 0, x = d.length; S < x; ) {
var b = d[S];
_.push(b), _.area += b.getLayout().area;
var w = JF(_, y, e.squareRatio);
w <= m ? (S++, m = w) : (_.area -= _.pop().getLayout().area, Lx(_, y, g, u, !1), y = ff(g.width, g.height), _.length = _.area = 0, m = 1 / 0);
}
if (_.length && Lx(_, y, g, u, !0), !t) {
var T = s.get("childrenVisibleMin");
T != null && p < T && (t = !0);
}
for (var S = 0, x = d.length; S < x; S++)
S2(d[S], e, t, n + 1);
}
}
}
function qF(r, e, t, n, a, i) {
var o = r.children || [], s = n.sort;
s !== "asc" && s !== "desc" && (s = null);
var l = n.leafDepth != null && n.leafDepth <= i;
if (a && !l)
return r.viewChildren = [];
o = At(o, function(v) {
return !v.isRemoved();
}), jF(o, s);
var u = QF(e, o, s);
if (u.sum === 0)
return r.viewChildren = [];
if (u.sum = KF(e, t, u.sum, s, o), u.sum === 0)
return r.viewChildren = [];
for (var h = 0, f = o.length; h < f; h++) {
var c = o[h].getValue() / u.sum * t;
o[h].setLayout({
area: c
});
}
return l && (o.length && r.setLayout({
isLeafRoot: !0
}, !0), o.length = 0), r.viewChildren = o, r.setLayout({
dataExtent: u.dataExtent
}, !0), o;
}
function KF(r, e, t, n, a) {
if (!n)
return t;
for (var i = r.get("visibleMin"), o = a.length, s = o, l = o - 1; l >= 0; l--) {
var u = a[n === "asc" ? o - l - 1 : l].getValue();
u / t * e < i && (s = l, t -= u);
}
return n === "asc" ? a.splice(0, o - s) : a.splice(s, o - s), t;
}
function jF(r, e) {
return e && r.sort(function(t, n) {
var a = e === "asc" ? t.getValue() - n.getValue() : n.getValue() - t.getValue();
return a === 0 ? e === "asc" ? t.dataIndex - n.dataIndex : n.dataIndex - t.dataIndex : a;
}), r;
}
function QF(r, e, t) {
for (var n = 0, a = 0, i = e.length; a < i; a++)
n += e[a].getValue();
var o = r.get("visualDimension"), s;
return !e || !e.length ? s = [NaN, NaN] : o === "value" && t ? (s = [e[e.length - 1].getValue(), e[0].getValue()], t === "asc" && s.reverse()) : (s = [1 / 0, -1 / 0], pm(e, function(l) {
var u = l.getValue(o);
u < s[0] && (s[0] = u), u > s[1] && (s[1] = u);
})), {
sum: n,
dataExtent: s
};
}
function JF(r, e, t) {
for (var n = 0, a = 1 / 0, i = 0, o = void 0, s = r.length; i < s; i++)
o = r[i].getLayout().area, o && (o < a && (a = o), o > n && (n = o));
var l = r.area * r.area, u = e * e * t;
return l ? Dl(u * n / l, l / (u * a)) : 1 / 0;
}
function Lx(r, e, t, n, a) {
var i = e === t.width ? 0 : 1, o = 1 - i, s = ["x", "y"], l = ["width", "height"], u = t[s[i]], h = e ? r.area / e : 0;
(a || h > t[l[o]]) && (h = t[l[o]]);
for (var f = 0, c = r.length; f < c; f++) {
var v = r[f], p = {}, d = h ? v.getLayout().area / h : 0, g = p[l[o]] = Dl(h - 2 * n, 0), y = t[s[i]] + t[l[i]] - u, m = f === c - 1 || y < d ? y : d, _ = p[l[i]] = Dl(m - 2 * n, 0);
p[s[o]] = t[s[o]] + ff(n, g / 2), p[s[i]] = u + ff(n, _ / 2), u += m, v.setLayout(p, !0);
}
t[s[o]] += h, t[l[o]] -= h;
}
function t4(r, e, t, n, a) {
var i = (e || {}).node, o = [n, a];
if (!i || i === t)
return o;
for (var s, l = n * a, u = l * r.option.zoomToNodeRatio; s = i.parentNode; ) {
for (var h = 0, f = s.children, c = 0, v = f.length; c < v; c++)
h += f[c].getValue();
var p = i.getValue();
if (p === 0)
return o;
u *= h / p;
var d = s.getModel(), g = d.get(_2), y = Math.max(g, b2(d));
u += 4 * g * g + (3 * g + y) * Math.pow(u, 0.5), u > G0 && (u = G0), i = s;
}
u < l && (u = l);
var m = Math.pow(u / l, 0.5);
return [n * m, a * m];
}
function e4(r, e, t) {
if (e)
return {
x: e.x,
y: e.y
};
var n = {
x: 0,
y: 0
};
if (!t)
return n;
var a = t.node, i = a.getLayout();
if (!i)
return n;
for (var o = [i.width / 2, i.height / 2], s = a; s; ) {
var l = s.getLayout();
o[0] += l.x, o[1] += l.y, s = s.parentNode;
}
return {
x: r.width / 2 - o[0],
y: r.height / 2 - o[1]
};
}
function x2(r, e, t, n, a) {
var i = r.getLayout(), o = t[a], s = o && o === r;
if (!(o && !s || a === t.length && r !== n)) {
r.setLayout({
// isInView means: viewRoot sub tree + viewAbovePath
isInView: !0,
// invisible only means: outside view clip so that the node can not
// see but still layout for animation preparation but not render.
invisible: !s && !e.intersect(i),
isAboveViewRoot: s
}, !0);
var l = new ct(e.x - i.x, e.y - i.y, e.width, e.height);
pm(r.viewChildren || [], function(u) {
x2(u, l, t, n, a + 1);
});
}
}
function b2(r) {
return r.get(YF) ? r.get(ZF) : 0;
}
function r4(r) {
r.registerSeriesModel(xF), r.registerChartView(PF), r.registerVisual(GF), r.registerLayout(XF), SF(r);
}
function n4(r) {
var e = r.findComponents({
mainType: "legend"
});
!e || !e.length || r.eachSeriesByType("graph", function(t) {
var n = t.getCategoriesData(), a = t.getGraph(), i = a.data, o = n.mapArray(n.getName);
i.filterSelf(function(s) {
var l = i.getItemModel(s), u = l.getShallow("category");
if (u != null) {
Tt(u) && (u = o[u]);
for (var h = 0; h < e.length; h++)
if (!e[h].isSelected(u))
return !1;
}
return !0;
});
});
}
function a4(r) {
var e = {};
r.eachSeriesByType("graph", function(t) {
var n = t.getCategoriesData(), a = t.getData(), i = {};
n.each(function(o) {
var s = n.getName(o);
i["ec-" + s] = o;
var l = n.getItemModel(o), u = l.getModel("itemStyle").getItemStyle();
u.fill || (u.fill = t.getColorFromPalette(s, e)), n.setItemVisual(o, "style", u);
for (var h = ["symbol", "symbolSize", "symbolKeepAspect"], f = 0; f < h.length; f++) {
var c = l.getShallow(h[f], !0);
c != null && n.setItemVisual(o, h[f], c);
}
}), n.count() && a.each(function(o) {
var s = a.getItemModel(o), l = s.getShallow("category");
if (l != null) {
U(l) && (l = i["ec-" + l]);
var u = n.getItemVisual(l, "style"), h = a.ensureUniqueItemVisual(o, "style");
B(h, u);
for (var f = ["symbol", "symbolSize", "symbolKeepAspect"], c = 0; c < f.length; c++)
a.setItemVisual(o, f[c], n.getItemVisual(l, f[c]));
}
});
});
}
function $u(r) {
return r instanceof Array || (r = [r, r]), r;
}
function i4(r) {
r.eachSeriesByType("graph", function(e) {
var t = e.getGraph(), n = e.getEdgeData(), a = $u(e.get("edgeSymbol")), i = $u(e.get("edgeSymbolSize"));
n.setVisual("fromSymbol", a && a[0]), n.setVisual("toSymbol", a && a[1]), n.setVisual("fromSymbolSize", i && i[0]), n.setVisual("toSymbolSize", i && i[1]), n.setVisual("style", e.getModel("lineStyle").getLineStyle()), n.each(function(o) {
var s = n.getItemModel(o), l = t.getEdgeByIndex(o), u = $u(s.getShallow("symbol", !0)), h = $u(s.getShallow("symbolSize", !0)), f = s.getModel("lineStyle").getLineStyle(), c = n.ensureUniqueItemVisual(o, "style");
switch (B(c, f), c.stroke) {
case "source": {
var v = l.node1.getVisual("style");
c.stroke = v && v.fill;
break;
}
case "target": {
var v = l.node2.getVisual("style");
c.stroke = v && v.fill;
break;
}
}
u[0] && l.setVisual("fromSymbol", u[0]), u[1] && l.setVisual("toSymbol", u[1]), h[0] && l.setVisual("fromSymbolSize", h[0]), h[1] && l.setVisual("toSymbolSize", h[1]);
});
});
}
var cg = "-->", dc = function(r) {
return r.get("autoCurveness") || null;
}, w2 = function(r, e) {
var t = dc(r), n = 20, a = [];
if (Tt(t))
n = t;
else if (z(t)) {
r.__curvenessList = t;
return;
}
e > n && (n = e);
var i = n % 2 ? n + 2 : n + 3;
a = [];
for (var o = 0; o < i; o++)
a.push((o % 2 ? o + 1 : o) / 10 * (o % 2 ? -1 : 1));
r.__curvenessList = a;
}, Al = function(r, e, t) {
var n = [r.id, r.dataIndex].join("."), a = [e.id, e.dataIndex].join(".");
return [t.uid, n, a].join(cg);
}, T2 = function(r) {
var e = r.split(cg);
return [e[0], e[2], e[1]].join(cg);
}, o4 = function(r, e) {
var t = Al(r.node1, r.node2, e);
return e.__edgeMap[t];
}, s4 = function(r, e) {
var t = vg(Al(r.node1, r.node2, e), e), n = vg(Al(r.node2, r.node1, e), e);
return t + n;
}, vg = function(r, e) {
var t = e.__edgeMap;
return t[r] ? t[r].length : 0;
};
function l4(r) {
dc(r) && (r.__curvenessList = [], r.__edgeMap = {}, w2(r));
}
function u4(r, e, t, n) {
if (dc(t)) {
var a = Al(r, e, t), i = t.__edgeMap, o = i[T2(a)];
i[a] && !o ? i[a].isForward = !0 : o && i[a] && (o.isForward = !0, i[a].isForward = !1), i[a] = i[a] || [], i[a].push(n);
}
}
function dm(r, e, t, n) {
var a = dc(e), i = z(a);
if (!a)
return null;
var o = o4(r, e);
if (!o)
return null;
for (var s = -1, l = 0; l < o.length; l++)
if (o[l] === t) {
s = l;
break;
}
var u = s4(r, e);
w2(e, u), r.lineStyle = r.lineStyle || {};
var h = Al(r.node1, r.node2, e), f = e.__curvenessList, c = i || u % 2 ? 0 : 1;
if (o.isForward)
return f[c + s];
var v = T2(h), p = vg(v, e), d = f[s + p + c];
return n ? i ? a && a[0] === 0 ? (p + c) % 2 ? d : -d : ((p % 2 ? 0 : 1) + c) % 2 ? d : -d : (p + c) % 2 ? d : -d : f[s + p + c];
}
function C2(r) {
var e = r.coordinateSystem;
if (!(e && e.type !== "view")) {
var t = r.getGraph();
t.eachNode(function(n) {
var a = n.getModel();
n.setLayout([+a.get("x"), +a.get("y")]);
}), gm(t, r);
}
}
function gm(r, e) {
r.eachEdge(function(t, n) {
var a = mr(t.getModel().get(["lineStyle", "curveness"]), -dm(t, e, n, !0), 0), i = Sn(t.node1.getLayout()), o = Sn(t.node2.getLayout()), s = [i, o];
+a && s.push([(i[0] + o[0]) / 2 - (i[1] - o[1]) * a, (i[1] + o[1]) / 2 - (o[0] - i[0]) * a]), t.setLayout(s);
});
}
function h4(r, e) {
r.eachSeriesByType("graph", function(t) {
var n = t.get("layout"), a = t.coordinateSystem;
if (a && a.type !== "view") {
var i = t.getData(), o = [];
A(a.dimensions, function(c) {
o = o.concat(i.mapDimensionsAll(c));
});
for (var s = 0; s < i.count(); s++) {
for (var l = [], u = !1, h = 0; h < o.length; h++) {
var f = i.get(o[h], s);
isNaN(f) || (u = !0), l.push(f);
}
u ? i.setItemLayout(s, a.dataToPoint(l)) : i.setItemLayout(s, [NaN, NaN]);
}
gm(i.graph, t);
} else (!n || n === "none") && C2(t);
});
}
function Fs(r) {
var e = r.coordinateSystem;
if (e.type !== "view")
return 1;
var t = r.option.nodeScaleRatio, n = e.scaleX, a = e.getZoom(), i = (a - 1) * t + 1;
return i / n;
}
function Hs(r) {
var e = r.getVisual("symbolSize");
return e instanceof Array && (e = (e[0] + e[1]) / 2), +e;
}
var Ex = Math.PI, tp = [];
function ym(r, e, t, n) {
var a = r.coordinateSystem;
if (!(a && a.type !== "view")) {
var i = a.getBoundingRect(), o = r.getData(), s = o.graph, l = i.width / 2 + i.x, u = i.height / 2 + i.y, h = Math.min(i.width, i.height) / 2, f = o.count();
if (o.setLayout({
cx: l,
cy: u
}), !!f) {
if (t) {
var c = a.pointToData(n), v = c[0], p = c[1], d = [v - l, p - u];
Oo(d, d), ih(d, d, h), t.setLayout([l + d[0], u + d[1]], !0);
var g = r.get(["circular", "rotateLabel"]);
D2(t, g, l, u);
}
f4[e](r, s, o, h, l, u, f), s.eachEdge(function(y, m) {
var _ = mr(y.getModel().get(["lineStyle", "curveness"]), dm(y, r, m), 0), S = Sn(y.node1.getLayout()), x = Sn(y.node2.getLayout()), b, w = (S[0] + x[0]) / 2, T = (S[1] + x[1]) / 2;
+_ && (_ *= 3, b = [l * _ + w * (1 - _), u * _ + T * (1 - _)]), y.setLayout([S, x, b]);
});
}
}
}
var f4 = {
value: function(r, e, t, n, a, i, o) {
var s = 0, l = t.getSum("value"), u = Math.PI * 2 / (l || o);
e.eachNode(function(h) {
var f = h.getValue("value"), c = u * (l ? f : 1) / 2;
s += c, h.setLayout([n * Math.cos(s) + a, n * Math.sin(s) + i]), s += c;
});
},
symbolSize: function(r, e, t, n, a, i, o) {
var s = 0;
tp.length = o;
var l = Fs(r);
e.eachNode(function(f) {
var c = Hs(f);
isNaN(c) && (c = 2), c < 0 && (c = 0), c *= l;
var v = Math.asin(c / 2 / n);
isNaN(v) && (v = Ex / 2), tp[f.dataIndex] = v, s += v * 2;
});
var u = (2 * Ex - s) / o / 2, h = 0;
e.eachNode(function(f) {
var c = u + tp[f.dataIndex];
h += c, (!f.getLayout() || !f.getLayout().fixed) && f.setLayout([n * Math.cos(h) + a, n * Math.sin(h) + i]), h += c;
});
}
};
function D2(r, e, t, n) {
var a = r.getGraphicEl();
if (a) {
var i = r.getModel(), o = i.get(["label", "rotate"]) || 0, s = a.getSymbolPath();
if (e) {
var l = r.getLayout(), u = Math.atan2(l[1] - n, l[0] - t);
u < 0 && (u = Math.PI * 2 + u);
var h = l[0] < t;
h && (u = u - Math.PI);
var f = h ? "left" : "right";
s.setTextConfig({
rotation: -u,
position: f,
origin: "center"
});
var c = s.ensureState("emphasis");
B(c.textConfig || (c.textConfig = {}), {
position: f
});
} else
s.setTextConfig({
rotation: o *= Math.PI / 180
});
}
}
function c4(r) {
r.eachSeriesByType("graph", function(e) {
e.get("layout") === "circular" && ym(e, "symbolSize");
});
}
var Ji = jp;
function v4(r, e, t) {
for (var n = r, a = e, i = t.rect, o = i.width, s = i.height, l = [i.x + o / 2, i.y + s / 2], u = t.gravity == null ? 0.1 : t.gravity, h = 0; h < n.length; h++) {
var f = n[h];
f.p || (f.p = Ii(o * (Math.random() - 0.5) + l[0], s * (Math.random() - 0.5) + l[1])), f.pp = Sn(f.p), f.edges = null;
}
var c = t.friction == null ? 0.6 : t.friction, v = c, p, d;
return {
warmUp: function() {
v = c * 0.8;
},
setFixed: function(g) {
n[g].fixed = !0;
},
setUnfixed: function(g) {
n[g].fixed = !1;
},
/**
* Before step hook
*/
beforeStep: function(g) {
p = g;
},
/**
* After step hook
*/
afterStep: function(g) {
d = g;
},
/**
* Some formulas were originally copied from "d3.js"
* https://github.com/d3/d3/blob/b516d77fb8566b576088e73410437494717ada26/src/layout/force.js
* with some modifications made for this project.
* See the license statement at the head of this file.
*/
step: function(g) {
p && p(n, a);
for (var y = [], m = n.length, _ = 0; _ < a.length; _++) {
var S = a[_];
if (!S.ignoreForceLayout) {
var x = S.n1, b = S.n2;
ei(y, b.p, x.p);
var w = Qp(y) - S.d, T = b.w / (x.w + b.w);
isNaN(T) && (T = 0), Oo(y, y), !x.fixed && Ji(x.p, x.p, y, T * w * v), !b.fixed && Ji(b.p, b.p, y, -(1 - T) * w * v);
}
}
for (var _ = 0; _ < m; _++) {
var C = n[_];
C.fixed || (ei(y, l, C.p), Ji(C.p, C.p, y, u * v));
}
for (var _ = 0; _ < m; _++)
for (var x = n[_], D = _ + 1; D < m; D++) {
var b = n[D];
ei(y, b.p, x.p);
var w = Qp(y);
w === 0 && (kE(y, Math.random() - 0.5, Math.random() - 0.5), w = 1);
var M = (x.rep + b.rep) / w / w;
!x.fixed && Ji(x.pp, x.pp, y, M), !b.fixed && Ji(b.pp, b.pp, y, -M);
}
for (var I = [], _ = 0; _ < m; _++) {
var C = n[_];
C.fixed || (ei(I, C.p, C.pp), Ji(C.p, C.p, I, v), Le(C.pp, C.p));
}
v = v * 0.992;
var L = v < 0.01;
d && d(n, a, L), g && g(L);
}
};
}
function p4(r) {
r.eachSeriesByType("graph", function(e) {
var t = e.coordinateSystem;
if (!(t && t.type !== "view"))
if (e.get("layout") === "force") {
var n = e.preservedPoints || {}, a = e.getGraph(), i = a.data, o = a.edgeData, s = e.getModel("force"), l = s.get("initLayout");
e.preservedPoints ? i.each(function(_) {
var S = i.getId(_);
i.setItemLayout(_, n[S] || [NaN, NaN]);
}) : !l || l === "none" ? C2(e) : l === "circular" && ym(e, "value");
var u = i.getDataExtent("value"), h = o.getDataExtent("value"), f = s.get("repulsion"), c = s.get("edgeLength"), v = z(f) ? f : [f, f], p = z(c) ? c : [c, c];
p = [p[1], p[0]];
var d = i.mapArray("value", function(_, S) {
var x = i.getItemLayout(S), b = Mt(_, u, v);
return isNaN(b) && (b = (v[0] + v[1]) / 2), {
w: b,
rep: b,
fixed: i.getItemModel(S).get("fixed"),
p: !x || isNaN(x[0]) || isNaN(x[1]) ? null : x
};
}), g = o.mapArray("value", function(_, S) {
var x = a.getEdgeByIndex(S), b = Mt(_, h, p);
isNaN(b) && (b = (p[0] + p[1]) / 2);
var w = x.getModel(), T = mr(x.getModel().get(["lineStyle", "curveness"]), -dm(x, e, S, !0), 0);
return {
n1: d[x.node1.dataIndex],
n2: d[x.node2.dataIndex],
d: b,
curveness: T,
ignoreForceLayout: w.get("ignoreForceLayout")
};
}), y = t.getBoundingRect(), m = v4(d, g, {
rect: y,
gravity: s.get("gravity"),
friction: s.get("friction")
});
m.beforeStep(function(_, S) {
for (var x = 0, b = _.length; x < b; x++)
_[x].fixed && Le(_[x].p, a.getNodeByIndex(x).getLayout());
}), m.afterStep(function(_, S, x) {
for (var b = 0, w = _.length; b < w; b++)
_[b].fixed || a.getNodeByIndex(b).setLayout(_[b].p), n[i.getId(b)] = _[b].p;
for (var b = 0, w = S.length; b < w; b++) {
var T = S[b], C = a.getEdgeByIndex(b), D = T.n1.p, M = T.n2.p, I = C.getLayout();
I = I ? I.slice() : [], I[0] = I[0] || [], I[1] = I[1] || [], Le(I[0], D), Le(I[1], M), +T.curveness && (I[2] = [(D[0] + M[0]) / 2 - (D[1] - M[1]) * T.curveness, (D[1] + M[1]) / 2 - (M[0] - D[0]) * T.curveness]), C.setLayout(I);
}
}), e.forceLayout = m, e.preservedPoints = n, m.step();
} else
e.forceLayout = null;
});
}
function d4(r, e, t) {
var n = B(r.getBoxLayoutParams(), {
aspect: t
});
return se(n, {
width: e.getWidth(),
height: e.getHeight()
});
}
function g4(r, e) {
var t = [];
return r.eachSeriesByType("graph", function(n) {
var a = n.get("coordinateSystem");
if (!a || a === "view") {
var i = n.getData(), o = i.mapArray(function(g) {
var y = i.getItemModel(g);
return [+y.get("x"), +y.get("y")];
}), s = [], l = [];
Hf(o, s, l), l[0] - s[0] === 0 && (l[0] += 1, s[0] -= 1), l[1] - s[1] === 0 && (l[1] += 1, s[1] -= 1);
var u = (l[0] - s[0]) / (l[1] - s[1]), h = d4(n, e, u);
isNaN(u) && (s = [h.x, h.y], l = [h.x + h.width, h.y + h.height]);
var f = l[0] - s[0], c = l[1] - s[1], v = h.width, p = h.height, d = n.coordinateSystem = new Jl();
d.zoomLimit = n.get("scaleLimit"), d.setBoundingRect(s[0], s[1], f, c), d.setViewRect(h.x, h.y, v, p), d.setCenter(n.get("center"), e), d.setZoom(n.get("zoom")), t.push(d);
}
}), t;
}
var Px = he.prototype, ep = zl.prototype, A2 = (
/** @class */
/* @__PURE__ */ function() {
function r() {
this.x1 = 0, this.y1 = 0, this.x2 = 0, this.y2 = 0, this.percent = 1;
}
return r;
}()
);
(function(r) {
O(e, r);
function e() {
return r !== null && r.apply(this, arguments) || this;
}
return e;
})(A2);
function rp(r) {
return isNaN(+r.cpx1) || isNaN(+r.cpy1);
}
var y4 = (
/** @class */
function(r) {
O(e, r);
function e(t) {
var n = r.call(this, t) || this;
return n.type = "ec-line", n;
}
return e.prototype.getDefaultStyle = function() {
return {
stroke: "#000",
fill: null
};
}, e.prototype.getDefaultShape = function() {
return new A2();
}, e.prototype.buildPath = function(t, n) {
rp(n) ? Px.buildPath.call(this, t, n) : ep.buildPath.call(this, t, n);
}, e.prototype.pointAt = function(t) {
return rp(this.shape) ? Px.pointAt.call(this, t) : ep.pointAt.call(this, t);
}, e.prototype.tangentAt = function(t) {
var n = this.shape, a = rp(n) ? [n.x2 - n.x1, n.y2 - n.y1] : ep.tangentAt.call(this, t);
return Oo(a, a);
}, e;
}(mt)
), np = ["fromSymbol", "toSymbol"];
function kx(r) {
return "_" + r + "Type";
}
function Rx(r, e, t) {
var n = e.getItemVisual(t, r);
if (!n || n === "none")
return n;
var a = e.getItemVisual(t, r + "Size"), i = e.getItemVisual(t, r + "Rotate"), o = e.getItemVisual(t, r + "Offset"), s = e.getItemVisual(t, r + "KeepAspect"), l = qo(a), u = ki(o || 0, l);
return n + l + u + (i || "") + (s || "");
}
function Nx(r, e, t) {
var n = e.getItemVisual(t, r);
if (!(!n || n === "none")) {
var a = e.getItemVisual(t, r + "Size"), i = e.getItemVisual(t, r + "Rotate"), o = e.getItemVisual(t, r + "Offset"), s = e.getItemVisual(t, r + "KeepAspect"), l = qo(a), u = ki(o || 0, l), h = ae(n, -l[0] / 2 + u[0], -l[1] / 2 + u[1], l[0], l[1], null, s);
return h.__specifiedRotation = i == null || isNaN(i) ? void 0 : +i * Math.PI / 180 || 0, h.name = r, h;
}
}
function m4(r) {
var e = new y4({
name: "line",
subPixelOptimize: !0
});
return pg(e.shape, r), e;
}
function pg(r, e) {
r.x1 = e[0][0], r.y1 = e[0][1], r.x2 = e[1][0], r.y2 = e[1][1], r.percent = 1;
var t = e[2];
t ? (r.cpx1 = t[0], r.cpy1 = t[1]) : (r.cpx1 = NaN, r.cpy1 = NaN);
}
var mm = (
/** @class */
function(r) {
O(e, r);
function e(t, n, a) {
var i = r.call(this) || this;
return i._createLine(t, n, a), i;
}
return e.prototype._createLine = function(t, n, a) {
var i = t.hostModel, o = t.getItemLayout(n), s = m4(o);
s.shape.percent = 0, $t(s, {
shape: {
percent: 1
}
}, i, n), this.add(s), A(np, function(l) {
var u = Nx(l, t, n);
this.add(u), this[kx(l)] = Rx(l, t, n);
}, this), this._updateCommonStl(t, n, a);
}, e.prototype.updateData = function(t, n, a) {
var i = t.hostModel, o = this.childOfName("line"), s = t.getItemLayout(n), l = {
shape: {}
};
pg(l.shape, s), Ct(o, l, i, n), A(np, function(u) {
var h = Rx(u, t, n), f = kx(u);
if (this[f] !== h) {
this.remove(this.childOfName(u));
var c = Nx(u, t, n);
this.add(c);
}
this[f] = h;
}, this), this._updateCommonStl(t, n, a);
}, e.prototype.getLinePath = function() {
return this.childAt(0);
}, e.prototype._updateCommonStl = function(t, n, a) {
var i = t.hostModel, o = this.childOfName("line"), s = a && a.emphasisLineStyle, l = a && a.blurLineStyle, u = a && a.selectLineStyle, h = a && a.labelStatesModels, f = a && a.emphasisDisabled, c = a && a.focus, v = a && a.blurScope;
if (!a || t.hasItemOption) {
var p = t.getItemModel(n), d = p.getModel("emphasis");
s = d.getModel("lineStyle").getLineStyle(), l = p.getModel(["blur", "lineStyle"]).getLineStyle(), u = p.getModel(["select", "lineStyle"]).getLineStyle(), f = d.get("disabled"), c = d.get("focus"), v = d.get("blurScope"), h = ve(p);
}
var g = t.getItemVisual(n, "style"), y = g.stroke;
o.useStyle(g), o.style.fill = null, o.style.strokeNoScale = !0, o.ensureState("emphasis").style = s, o.ensureState("blur").style = l, o.ensureState("select").style = u, A(np, function(b) {
var w = this.childOfName(b);
if (w) {
w.setColor(y), w.style.opacity = g.opacity;
for (var T = 0; T < ze.length; T++) {
var C = ze[T], D = o.getState(C);
if (D) {
var M = D.style || {}, I = w.ensureState(C), L = I.style || (I.style = {});
M.stroke != null && (L[w.__isEmptyBrush ? "stroke" : "fill"] = M.stroke), M.opacity != null && (L.opacity = M.opacity);
}
}
w.markRedraw();
}
}, this);
var m = i.getRawValue(n);
xe(this, h, {
labelDataIndex: n,
labelFetcher: {
getFormattedLabel: function(b, w) {
return i.getFormattedLabel(b, w, t.dataType);
}
},
inheritColor: y || "#000",
defaultOpacity: g.opacity,
defaultText: (m == null ? t.getName(n) : isFinite(m) ? jt(m) : m) + ""
});
var _ = this.getTextContent();
if (_) {
var S = h.normal;
_.__align = _.style.align, _.__verticalAlign = _.style.verticalAlign, _.__position = S.get("position") || "middle";
var x = S.get("distance");
z(x) || (x = [x, x]), _.__labelDistance = x;
}
this.setTextConfig({
position: null,
local: !0,
inside: !1
// Can't be inside for stroke element.
}), Xt(this, c, v, f);
}, e.prototype.highlight = function() {
Mn(this);
}, e.prototype.downplay = function() {
In(this);
}, e.prototype.updateLayout = function(t, n) {
this.setLinePoints(t.getItemLayout(n));
}, e.prototype.setLinePoints = function(t) {
var n = this.childOfName("line");
pg(n.shape, t), n.dirty();
}, e.prototype.beforeUpdate = function() {
var t = this, n = t.childOfName("fromSymbol"), a = t.childOfName("toSymbol"), i = t.getTextContent();
if (!n && !a && (!i || i.ignore))
return;
for (var o = 1, s = this.parent; s; )
s.scaleX && (o /= s.scaleX), s = s.parent;
var l = t.childOfName("line");
if (!this.__dirty && !l.__dirty)
return;
var u = l.shape.percent, h = l.pointAt(0), f = l.pointAt(u), c = ei([], f, h);
Oo(c, c);
function v(D, M) {
var I = D.__specifiedRotation;
if (I == null) {
var L = l.tangentAt(M);
D.attr("rotation", (M === 1 ? -1 : 1) * Math.PI / 2 - Math.atan2(L[1], L[0]));
} else
D.attr("rotation", I);
}
if (n && (n.setPosition(h), v(n, 0), n.scaleX = n.scaleY = o * u, n.markRedraw()), a && (a.setPosition(f), v(a, 1), a.scaleX = a.scaleY = o * u, a.markRedraw()), i && !i.ignore) {
i.x = i.y = 0, i.originX = i.originY = 0;
var p = void 0, d = void 0, g = i.__labelDistance, y = g[0] * o, m = g[1] * o, _ = u / 2, S = l.tangentAt(_), x = [S[1], -S[0]], b = l.pointAt(_);
x[1] > 0 && (x[0] = -x[0], x[1] = -x[1]);
var w = S[0] < 0 ? -1 : 1;
if (i.__position !== "start" && i.__position !== "end") {
var T = -Math.atan2(S[1], S[0]);
f[0] < h[0] && (T = Math.PI + T), i.rotation = T;
}
var C = void 0;
switch (i.__position) {
case "insideStartTop":
case "insideMiddleTop":
case "insideEndTop":
case "middle":
C = -m, d = "bottom";
break;
case "insideStartBottom":
case "insideMiddleBottom":
case "insideEndBottom":
C = m, d = "top";
break;
default:
C = 0, d = "middle";
}
switch (i.__position) {
case "end":
i.x = c[0] * y + f[0], i.y = c[1] * m + f[1], p = c[0] > 0.8 ? "left" : c[0] < -0.8 ? "right" : "center", d = c[1] > 0.8 ? "top" : c[1] < -0.8 ? "bottom" : "middle";
break;
case "start":
i.x = -c[0] * y + h[0], i.y = -c[1] * m + h[1], p = c[0] > 0.8 ? "right" : c[0] < -0.8 ? "left" : "center", d = c[1] > 0.8 ? "bottom" : c[1] < -0.8 ? "top" : "middle";
break;
case "insideStartTop":
case "insideStart":
case "insideStartBottom":
i.x = y * w + h[0], i.y = h[1] + C, p = S[0] < 0 ? "right" : "left", i.originX = -y * w, i.originY = -C;
break;
case "insideMiddleTop":
case "insideMiddle":
case "insideMiddleBottom":
case "middle":
i.x = b[0], i.y = b[1] + C, p = "center", i.originY = -C;
break;
case "insideEndTop":
case "insideEnd":
case "insideEndBottom":
i.x = -y * w + f[0], i.y = f[1] + C, p = S[0] >= 0 ? "right" : "left", i.originX = y * w, i.originY = -C;
break;
}
i.scaleX = i.scaleY = o, i.setStyle({
// Use the user specified text align and baseline first
verticalAlign: i.__verticalAlign || d,
align: i.__align || p
});
}
}, e;
}(at)
), _m = (
/** @class */
function() {
function r(e) {
this.group = new at(), this._LineCtor = e || mm;
}
return r.prototype.updateData = function(e) {
var t = this;
this._progressiveEls = null;
var n = this, a = n.group, i = n._lineData;
n._lineData = e, i || a.removeAll();
var o = Ox(e);
e.diff(i).add(function(s) {
t._doAdd(e, s, o);
}).update(function(s, l) {
t._doUpdate(i, e, l, s, o);
}).remove(function(s) {
a.remove(i.getItemGraphicEl(s));
}).execute();
}, r.prototype.updateLayout = function() {
var e = this._lineData;
e && e.eachItemGraphicEl(function(t, n) {
t.updateLayout(e, n);
}, this);
}, r.prototype.incrementalPrepareUpdate = function(e) {
this._seriesScope = Ox(e), this._lineData = null, this.group.removeAll();
}, r.prototype.incrementalUpdate = function(e, t) {
this._progressiveEls = [];
function n(s) {
!s.isGroup && !_4(s) && (s.incremental = !0, s.ensureState("emphasis").hoverLayer = !0);
}
for (var a = e.start; a < e.end; a++) {
var i = t.getItemLayout(a);
if (ap(i)) {
var o = new this._LineCtor(t, a, this._seriesScope);
o.traverse(n), this.group.add(o), t.setItemGraphicEl(a, o), this._progressiveEls.push(o);
}
}
}, r.prototype.remove = function() {
this.group.removeAll();
}, r.prototype.eachRendered = function(e) {
ma(this._progressiveEls || this.group, e);
}, r.prototype._doAdd = function(e, t, n) {
var a = e.getItemLayout(t);
if (ap(a)) {
var i = new this._LineCtor(e, t, n);
e.setItemGraphicEl(t, i), this.group.add(i);
}
}, r.prototype._doUpdate = function(e, t, n, a, i) {
var o = e.getItemGraphicEl(n);
if (!ap(t.getItemLayout(a))) {
this.group.remove(o);
return;
}
o ? o.updateData(t, a, i) : o = new this._LineCtor(t, a, i), t.setItemGraphicEl(a, o), this.group.add(o);
}, r;
}()
);
function _4(r) {
return r.animators && r.animators.length > 0;
}
function Ox(r) {
var e = r.hostModel, t = e.getModel("emphasis");
return {
lineStyle: e.getModel("lineStyle").getLineStyle(),
emphasisLineStyle: t.getModel(["lineStyle"]).getLineStyle(),
blurLineStyle: e.getModel(["blur", "lineStyle"]).getLineStyle(),
selectLineStyle: e.getModel(["select", "lineStyle"]).getLineStyle(),
emphasisDisabled: t.get("disabled"),
blurScope: t.get("blurScope"),
focus: t.get("focus"),
labelStatesModels: ve(e)
};
}
function Vx(r) {
return isNaN(r[0]) || isNaN(r[1]);
}
function ap(r) {
return r && !Vx(r[0]) && !Vx(r[1]);
}
var ip = [], op = [], sp = [], to = de, lp = ui, Bx = Math.abs;
function zx(r, e, t) {
for (var n = r[0], a = r[1], i = r[2], o = 1 / 0, s, l = t * t, u = 0.1, h = 0.1; h <= 0.9; h += 0.1) {
ip[0] = to(n[0], a[0], i[0], h), ip[1] = to(n[1], a[1], i[1], h);
var f = Bx(lp(ip, e) - l);
f < o && (o = f, s = h);
}
for (var c = 0; c < 32; c++) {
var v = s + u;
op[0] = to(n[0], a[0], i[0], s), op[1] = to(n[1], a[1], i[1], s), sp[0] = to(n[0], a[0], i[0], v), sp[1] = to(n[1], a[1], i[1], v);
var f = lp(op, e) - l;
if (Bx(f) < 0.01)
break;
var p = lp(sp, e) - l;
u /= 2, f < 0 ? p >= 0 ? s = s + u : s = s - u : p >= 0 ? s = s - u : s = s + u;
}
return s;
}
function up(r, e) {
var t = [], n = sl, a = [[], [], []], i = [[], []], o = [];
e /= 2, r.eachEdge(function(s, l) {
var u = s.getLayout(), h = s.getVisual("fromSymbol"), f = s.getVisual("toSymbol");
u.__original || (u.__original = [Sn(u[0]), Sn(u[1])], u[2] && u.__original.push(Sn(u[2])));
var c = u.__original;
if (u[2] != null) {
if (Le(a[0], c[0]), Le(a[1], c[2]), Le(a[2], c[1]), h && h !== "none") {
var v = Hs(s.node1), p = zx(a, c[0], v * e);
n(a[0][0], a[1][0], a[2][0], p, t), a[0][0] = t[3], a[1][0] = t[4], n(a[0][1], a[1][1], a[2][1], p, t), a[0][1] = t[3], a[1][1] = t[4];
}
if (f && f !== "none") {
var v = Hs(s.node2), p = zx(a, c[1], v * e);
n(a[0][0], a[1][0], a[2][0], p, t), a[1][0] = t[1], a[2][0] = t[2], n(a[0][1], a[1][1], a[2][1], p, t), a[1][1] = t[1], a[2][1] = t[2];
}
Le(u[0], a[0]), Le(u[1], a[2]), Le(u[2], a[1]);
} else {
if (Le(i[0], c[0]), Le(i[1], c[1]), ei(o, i[1], i[0]), Oo(o, o), h && h !== "none") {
var v = Hs(s.node1);
jp(i[0], i[0], o, v * e);
}
if (f && f !== "none") {
var v = Hs(s.node2);
jp(i[1], i[1], o, -v * e);
}
Le(u[0], i[0]), Le(u[1], i[1]);
}
});
}
function Gx(r) {
return r.type === "view";
}
var S4 = (
/** @class */
function(r) {
O(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t.type = e.type, t;
}
return e.prototype.init = function(t, n) {
var a = new Zl(), i = new _m(), o = this.group;
this._controller = new Ql(n.getZr()), this._controllerHost = {
target: o
}, o.add(a.group), o.add(i.group), this._symbolDraw = a, this._lineDraw = i, this._firstRender = !0;
}, e.prototype.render = function(t, n, a) {
var i = this, o = t.coordinateSystem;
this._model = t;
var s = this._symbolDraw, l = this._lineDraw, u = this.group;
if (Gx(o)) {
var h = {
x: o.x,
y: o.y,
scaleX: o.scaleX,
scaleY: o.scaleY
};
this._firstRender ? u.attr(h) : Ct(u, h, t);
}
up(t.getGraph(), Fs(t));
var f = t.getData();
s.updateData(f);
var c = t.getEdgeData();
l.updateData(c), this._updateNodeAndLinkScale(), this._updateController(t, n, a), clearTimeout(this._layoutTimeout);
var v = t.forceLayout, p = t.get(["force", "layoutAnimation"]);
v && this._startForceLayoutIteration(v, p);
var d = t.get("layout");
f.graph.eachNode(function(_) {
var S = _.dataIndex, x = _.getGraphicEl(), b = _.getModel();
if (x) {
x.off("drag").off("dragend");
var w = b.get("draggable");
w && x.on("drag", function(C) {
switch (d) {
case "force":
v.warmUp(), !i._layouting && i._startForceLayoutIteration(v, p), v.setFixed(S), f.setItemLayout(S, [x.x, x.y]);
break;
case "circular":
f.setItemLayout(S, [x.x, x.y]), _.setLayout({
fixed: !0
}, !0), ym(t, "symbolSize", _, [C.offsetX, C.offsetY]), i.updateLayout(t);
break;
case "none":
default:
f.setItemLayout(S, [x.x, x.y]), gm(t.getGraph(), t), i.updateLayout(t);
break;
}
}).on("dragend", function() {
v && v.setUnfixed(S);
}), x.setDraggable(w, !!b.get("cursor"));
var T = b.get(["emphasis", "focus"]);
T === "adjacency" && (it(x).focus = _.getAdjacentDataIndices());
}
}), f.graph.eachEdge(function(_) {
var S = _.getGraphicEl(), x = _.getModel().get(["emphasis", "focus"]);
S && x === "adjacency" && (it(S).focus = {
edge: [_.dataIndex],
node: [_.node1.dataIndex, _.node2.dataIndex]
});
});
var g = t.get("layout") === "circular" && t.get(["circular", "rotateLabel"]), y = f.getLayout("cx"), m = f.getLayout("cy");
f.graph.eachNode(function(_) {
D2(_, g, y, m);
}), this._firstRender = !1;
}, e.prototype.dispose = function() {
this.remove(), this._controller && this._controller.dispose(), this._controllerHost = null;
}, e.prototype._startForceLayoutIteration = function(t, n) {
var a = this;
(function i() {
t.step(function(o) {
a.updateLayout(a._model), (a._layouting = !o) && (n ? a._layoutTimeout = setTimeout(i, 16) : i());
});
})();
}, e.prototype._updateController = function(t, n, a) {
var i = this, o = this._controller, s = this._controllerHost, l = this.group;
if (o.setPointerChecker(function(u, h, f) {
var c = l.getBoundingRect();
return c.applyTransform(l.transform), c.contain(h, f) && !cc(u, a, t);
}), !Gx(t.coordinateSystem)) {
o.disable();
return;
}
o.enable(t.get("roam")), s.zoomLimit = t.get("scaleLimit"), s.zoom = t.coordinateSystem.getZoom(), o.off("pan").off("zoom").on("pan", function(u) {
sm(s, u.dx, u.dy), a.dispatchAction({
seriesId: t.id,
type: "graphRoam",
dx: u.dx,
dy: u.dy
});
}).on("zoom", function(u) {
lm(s, u.scale, u.originX, u.originY), a.dispatchAction({
seriesId: t.id,
type: "graphRoam",
zoom: u.scale,
originX: u.originX,
originY: u.originY
}), i._updateNodeAndLinkScale(), up(t.getGraph(), Fs(t)), i._lineDraw.updateLayout(), a.updateLabelLayout();
});
}, e.prototype._updateNodeAndLinkScale = function() {
var t = this._model, n = t.getData(), a = Fs(t);
n.eachItemGraphicEl(function(i, o) {
i && i.setSymbolScale(a);
});
}, e.prototype.updateLayout = function(t) {
up(t.getGraph(), Fs(t)), this._symbolDraw.updateLayout(), this._lineDraw.updateLayout();
}, e.prototype.remove = function() {
clearTimeout(this._layoutTimeout), this._layouting = !1, this._layoutTimeout = null, this._symbolDraw && this._symbolDraw.remove(), this._lineDraw && this._lineDraw.remove();
}, e.type = "graph", e;
}(kt)
);
function eo(r) {
return "_EC_" + r;
}
var x4 = (
/** @class */
function() {
function r(e) {
this.type = "graph", this.nodes = [], this.edges = [], this._nodesMap = {}, this._edgesMap = {}, this._directed = e || !1;
}
return r.prototype.isDirected = function() {
return this._directed;
}, r.prototype.addNode = function(e, t) {
e = e == null ? "" + t : "" + e;
var n = this._nodesMap;
if (n[eo(e)]) {
process.env.NODE_ENV !== "production" && console.error("Graph nodes have duplicate name or id");
return;
}
var a = new qa(e, t);
return a.hostGraph = this, this.nodes.push(a), n[eo(e)] = a, a;
}, r.prototype.getNodeByIndex = function(e) {
var t = this.data.getRawIndex(e);
return this.nodes[t];
}, r.prototype.getNodeById = function(e) {
return this._nodesMap[eo(e)];
}, r.prototype.addEdge = function(e, t, n) {
var a = this._nodesMap, i = this._edgesMap;
if (Tt(e) && (e = this.nodes[e]), Tt(t) && (t = this.nodes[t]), e instanceof qa || (e = a[eo(e)]), t instanceof qa || (t = a[eo(t)]), !(!e || !t)) {
var o = e.id + "-" + t.id, s = new M2(e, t, n);
return s.hostGraph = this, this._directed && (e.outEdges.push(s), t.inEdges.push(s)), e.edges.push(s), e !== t && t.edges.push(s), this.edges.push(s), i[o] = s, s;
}
}, r.prototype.getEdgeByIndex = function(e) {
var t = this.edgeData.getRawIndex(e);
return this.edges[t];
}, r.prototype.getEdge = function(e, t) {
e instanceof qa && (e = e.id), t instanceof qa && (t = t.id);
var n = this._edgesMap;
return this._directed ? n[e + "-" + t] : n[e + "-" + t] || n[t + "-" + e];
}, r.prototype.eachNode = function(e, t) {
for (var n = this.nodes, a = n.length, i = 0; i < a; i++)
n[i].dataIndex >= 0 && e.call(t, n[i], i);
}, r.prototype.eachEdge = function(e, t) {
for (var n = this.edges, a = n.length, i = 0; i < a; i++)
n[i].dataIndex >= 0 && n[i].node1.dataIndex >= 0 && n[i].node2.dataIndex >= 0 && e.call(t, n[i], i);
}, r.prototype.breadthFirstTraverse = function(e, t, n, a) {
if (t instanceof qa || (t = this._nodesMap[eo(t)]), !!t) {
for (var i = n === "out" ? "outEdges" : n === "in" ? "inEdges" : "edges", o = 0; o < this.nodes.length; o++)
this.nodes[o].__visited = !1;
if (!e.call(a, t, null))
for (var s = [t]; s.length; )
for (var l = s.shift(), u = l[i], o = 0; o < u.length; o++) {
var h = u[o], f = h.node1 === l ? h.node2 : h.node1;
if (!f.__visited) {
if (e.call(a, f, l))
return;
s.push(f), f.__visited = !0;
}
}
}
}, r.prototype.update = function() {
for (var e = this.data, t = this.edgeData, n = this.nodes, a = this.edges, i = 0, o = n.length; i < o; i++)
n[i].dataIndex = -1;
for (var i = 0, o = e.count(); i < o; i++)
n[e.getRawIndex(i)].dataIndex = i;
t.filterSelf(function(s) {
var l = a[t.getRawIndex(s)];
return l.node1.dataIndex >= 0 && l.node2.dataIndex >= 0;
});
for (var i = 0, o = a.length; i < o; i++)
a[i].dataIndex = -1;
for (var i = 0, o = t.count(); i < o; i++)
a[t.getRawIndex(i)].dataIndex = i;
}, r.prototype.clone = function() {
for (var e = new r(this._directed), t = this.nodes, n = this.edges, a = 0; a < t.length; a++)
e.addNode(t[a].id, t[a].dataIndex);
for (var a = 0; a < n.length; a++) {
var i = n[a];
e.addEdge(i.node1.id, i.node2.id, i.dataIndex);
}
return e;
}, r;
}()
), qa = (
/** @class */
function() {
function r(e, t) {
this.inEdges = [], this.outEdges = [], this.edges = [], this.dataIndex = -1, this.id = e ?? "", this.dataIndex = t ?? -1;
}
return r.prototype.degree = function() {
return this.edges.length;
}, r.prototype.inDegree = function() {
return this.inEdges.length;
}, r.prototype.outDegree = function() {
return this.outEdges.length;
}, r.prototype.getModel = function(e) {
if (!(this.dataIndex < 0)) {
var t = this.hostGraph, n = t.data.getItemModel(this.dataIndex);
return n.getModel(e);
}
}, r.prototype.getAdjacentDataIndices = function() {
for (var e = {
edge: [],
node: []
}, t = 0; t < this.edges.length; t++) {
var n = this.edges[t];
n.dataIndex < 0 || (e.edge.push(n.dataIndex), e.node.push(n.node1.dataIndex, n.node2.dataIndex));
}
return e;
}, r.prototype.getTrajectoryDataIndices = function() {
for (var e = X(), t = X(), n = 0; n < this.edges.length; n++) {
var a = this.edges[n];
if (!(a.dataIndex < 0)) {
e.set(a.dataIndex, !0);
for (var i = [a.node1], o = [a.node2], s = 0; s < i.length; ) {
var l = i[s];
s++, t.set(l.dataIndex, !0);
for (var u = 0; u < l.inEdges.length; u++)
e.set(l.inEdges[u].dataIndex, !0), i.push(l.inEdges[u].node1);
}
for (s = 0; s < o.length; ) {
var h = o[s];
s++, t.set(h.dataIndex, !0);
for (var u = 0; u < h.outEdges.length; u++)
e.set(h.outEdges[u].dataIndex, !0), o.push(h.outEdges[u].node2);
}
}
}
return {
edge: e.keys(),
node: t.keys()
};
}, r;
}()
), M2 = (
/** @class */
function() {
function r(e, t, n) {
this.dataIndex = -1, this.node1 = e, this.node2 = t, this.dataIndex = n ?? -1;
}
return r.prototype.getModel = function(e) {
if (!(this.dataIndex < 0)) {
var t = this.hostGraph, n = t.edgeData.getItemModel(this.dataIndex);
return n.getModel(e);
}
}, r.prototype.getAdjacentDataIndices = function() {
return {
edge: [this.dataIndex],
node: [this.node1.dataIndex, this.node2.dataIndex]
};
}, r.prototype.getTrajectoryDataIndices = function() {
var e = X(), t = X();
e.set(this.dataIndex, !0);
for (var n = [this.node1], a = [this.node2], i = 0; i < n.length; ) {
var o = n[i];
i++, t.set(o.dataIndex, !0);
for (var s = 0; s < o.inEdges.length; s++)
e.set(o.inEdges[s].dataIndex, !0), n.push(o.inEdges[s].node1);
}
for (i = 0; i < a.length; ) {
var l = a[i];
i++, t.set(l.dataIndex, !0);
for (var s = 0; s < l.outEdges.length; s++)
e.set(l.outEdges[s].dataIndex, !0), a.push(l.outEdges[s].node2);
}
return {
edge: e.keys(),
node: t.keys()
};
}, r;
}()
);
function I2(r, e) {
return {
/**
* @param Default 'value'. can be 'a', 'b', 'c', 'd', 'e'.
*/
getValue: function(t) {
var n = this[r][e];
return n.getStore().get(n.getDimensionIndex(t || "value"), this.dataIndex);
},
// TODO: TYPE stricter type.
setVisual: function(t, n) {
this.dataIndex >= 0 && this[r][e].setItemVisual(this.dataIndex, t, n);
},
getVisual: function(t) {
return this[r][e].getItemVisual(this.dataIndex, t);
},
setLayout: function(t, n) {
this.dataIndex >= 0 && this[r][e].setItemLayout(this.dataIndex, t, n);
},
getLayout: function() {
return this[r][e].getItemLayout(this.dataIndex);
},
getGraphicEl: function() {
return this[r][e].getItemGraphicEl(this.dataIndex);
},
getRawIndex: function() {
return this[r][e].getRawIndex(this.dataIndex);
}
};
}
ie(qa, I2("hostGraph", "data"));
ie(M2, I2("hostGraph", "edgeData"));
function L2(r, e, t, n, a) {
for (var i = new x4(n), o = 0; o < r.length; o++)
i.addNode(re(
// Id, name, dataIndex
r[o].id,
r[o].name,
o
), o);
for (var s = [], l = [], u = 0, o = 0; o < e.length; o++) {
var h = e[o], f = h.source, c = h.target;
i.addEdge(f, c, u) && (l.push(h), s.push(re(oe(h.id, null), f + " > " + c)), u++);
}
var v = t.get("coordinateSystem"), p;
if (v === "cartesian2d" || v === "polar")
p = On(r, t);
else {
var d = Yo.get(v), g = d ? d.dimensions || [] : [];
pt(g, "value") < 0 && g.concat(["value"]);
var y = $l(r, {
coordDimensions: g,
encodeDefine: t.getEncode()
}).dimensions;
p = new Ne(y, t), p.initData(r);
}
var m = new Ne(["value"], t);
return m.initData(l, s), a && a(p, m), f2({
mainData: p,
struct: i,
structAttr: "graph",
datas: {
node: p,
edge: m
},
datasAttr: {
node: "data",
edge: "edgeData"
}
}), i.update(), i;
}
var b4 = (
/** @class */
function(r) {
O(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t.type = e.type, t.hasSymbolVisual = !0, t;
}
return e.prototype.init = function(t) {
r.prototype.init.apply(this, arguments);
var n = this;
function a() {
return n._categoriesData;
}
this.legendVisualProvider = new jl(a, a), this.fillDataTextStyle(t.edges || t.links), this._updateCategoriesData();
}, e.prototype.mergeOption = function(t) {
r.prototype.mergeOption.apply(this, arguments), this.fillDataTextStyle(t.edges || t.links), this._updateCategoriesData();
}, e.prototype.mergeDefaultAndTheme = function(t) {
r.prototype.mergeDefaultAndTheme.apply(this, arguments), xi(t, "edgeLabel", ["show"]);
}, e.prototype.getInitialData = function(t, n) {
var a = t.edges || t.links || [], i = t.data || t.nodes || [], o = this;
if (i && a) {
l4(this);
var s = L2(i, a, this, !0, l);
return A(s.edges, function(u) {
u4(u.node1, u.node2, this, u.dataIndex);
}, this), s.data;
}
function l(u, h) {
u.wrapMethod("getItemModel", function(p) {
var d = o._categoriesModels, g = p.getShallow("category"), y = d[g];
return y && (y.parentModel = p.parentModel, p.parentModel = y), p;
});
var f = It.prototype.getModel;
function c(p, d) {
var g = f.call(this, p, d);
return g.resolveParentPath = v, g;
}
h.wrapMethod("getItemModel", function(p) {
return p.resolveParentPath = v, p.getModel = c, p;
});
function v(p) {
if (p && (p[0] === "label" || p[1] === "label")) {
var d = p.slice();
return p[0] === "label" ? d[0] = "edgeLabel" : p[1] === "label" && (d[1] = "edgeLabel"), d;
}
return p;
}
}
}, e.prototype.getGraph = function() {
return this.getData().graph;
}, e.prototype.getEdgeData = function() {
return this.getGraph().edgeData;
}, e.prototype.getCategoriesData = function() {
return this._categoriesData;
}, e.prototype.formatTooltip = function(t, n, a) {
if (a === "edge") {
var i = this.getData(), o = this.getDataParams(t, a), s = i.graph.getEdgeByIndex(t), l = i.getName(s.node1.dataIndex), u = i.getName(s.node2.dataIndex), h = [];
return l != null && h.push(l), u != null && h.push(u), pe("nameValue", {
name: h.join(" > "),
value: o.value,
noValue: o.value == null
});
}
var f = eA({
series: this,
dataIndex: t,
multipleSeries: n
});
return f;
}, e.prototype._updateCategoriesData = function() {
var t = G(this.option.categories || [], function(a) {
return a.value != null ? a : B({
value: 0
}, a);
}), n = new Ne(["value"], this);
n.initData(t), this._categoriesData = n, this._categoriesModels = n.mapArray(function(a) {
return n.getItemModel(a);
});
}, e.prototype.setZoom = function(t) {
this.option.zoom = t;
}, e.prototype.setCenter = function(t) {
this.option.center = t;
}, e.prototype.isAnimationEnabled = function() {
return r.prototype.isAnimationEnabled.call(this) && !(this.get("layout") === "force" && this.get(["force", "layoutAnimation"]));
}, e.type = "series.graph", e.dependencies = ["grid", "polar", "geo", "singleAxis", "calendar"], e.defaultOption = {
// zlevel: 0,
z: 2,
coordinateSystem: "view",
// Default option for all coordinate systems
// xAxisIndex: 0,
// yAxisIndex: 0,
// polarIndex: 0,
// geoIndex: 0,
legendHoverLink: !0,
layout: null,
// Configuration of circular layout
circular: {
rotateLabel: !1
},
// Configuration of force directed layout
force: {
initLayout: null,
// Node repulsion. Can be an array to represent range.
repulsion: [0, 50],
gravity: 0.1,
// Initial friction
friction: 0.6,
// Edge length. Can be an array to represent range.
edgeLength: 30,
layoutAnimation: !0
},
left: "center",
top: "center",
// right: null,
// bottom: null,
// width: '80%',
// height: '80%',
symbol: "circle",
symbolSize: 10,
edgeSymbol: ["none", "none"],
edgeSymbolSize: 10,
edgeLabel: {
position: "middle",
distance: 5
},
draggable: !1,
roam: !1,
// Default on center of graph
center: null,
zoom: 1,
// Symbol size scale ratio in roam
nodeScaleRatio: 0.6,
// cursor: null,
// categories: [],
// data: []
// Or
// nodes: []
//
// links: []
// Or
// edges: []
label: {
show: !1,
formatter: "{b}"
},
itemStyle: {},
lineStyle: {
color: "#aaa",
width: 1,
opacity: 0.5
},
emphasis: {
scale: !0,
label: {
show: !0
}
},
select: {
itemStyle: {
borderColor: "#212121"
}
}
}, e;
}(Ft)
), w4 = {
type: "graphRoam",
event: "graphRoam",
update: "none"
};
function T4(r) {
r.registerChartView(S4), r.registerSeriesModel(b4), r.registerProcessor(n4), r.registerVisual(a4), r.registerVisual(i4), r.registerLayout(h4), r.registerLayout(r.PRIORITY.VISUAL.POST_CHART_LAYOUT, c4), r.registerLayout(p4), r.registerCoordinateSystem("graphView", {
dimensions: Jl.dimensions,
create: g4
}), r.registerAction({
type: "focusNodeAdjacency",
event: "focusNodeAdjacency",
update: "series:focusNodeAdjacency"
}, Jt), r.registerAction({
type: "unfocusNodeAdjacency",
event: "unfocusNodeAdjacency",
update: "series:unfocusNodeAdjacency"
}, Jt), r.registerAction(w4, function(e, t, n) {
t.eachComponent({
mainType: "series",
query: e
}, function(a) {
var i = a.coordinateSystem, o = hm(i, e, void 0, n);
a.setCenter && a.setCenter(o.center), a.setZoom && a.setZoom(o.zoom);
});
});
}
var C4 = (
/** @class */
/* @__PURE__ */ function() {
function r() {
this.angle = 0, this.width = 10, this.r = 10, this.x = 0, this.y = 0;
}
return r;
}()
), D4 = (
/** @class */
function(r) {
O(e, r);
function e(t) {
var n = r.call(this, t) || this;
return n.type = "pointer", n;
}
return e.prototype.getDefaultShape = function() {
return new C4();
}, e.prototype.buildPath = function(t, n) {
var a = Math.cos, i = Math.sin, o = n.r, s = n.width, l = n.angle, u = n.x - a(l) * s * (s >= o / 3 ? 1 : 2), h = n.y - i(l) * s * (s >= o / 3 ? 1 : 2);
l = n.angle - Math.PI / 2, t.moveTo(u, h), t.lineTo(n.x + a(l) * s, n.y + i(l) * s), t.lineTo(n.x + a(n.angle) * o, n.y + i(n.angle) * o), t.lineTo(n.x - a(l) * s, n.y - i(l) * s), t.lineTo(u, h);
}, e;
}(mt)
);
function A4(r, e) {
var t = r.get("center"), n = e.getWidth(), a = e.getHeight(), i = Math.min(n, a), o = W(t[0], e.getWidth()), s = W(t[1], e.getHeight()), l = W(r.get("radius"), i / 2);
return {
cx: o,
cy: s,
r: l
};
}
function Uu(r, e) {
var t = r == null ? "" : r + "";
return e && (U(e) ? t = e.replace("{value}", t) : K(e) && (t = e(r))), t;
}
var M4 = (
/** @class */
function(r) {
O(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t.type = e.type, t;
}
return e.prototype.render = function(t, n, a) {
this.group.removeAll();
var i = t.get(["axisLine", "lineStyle", "color"]), o = A4(t, a);
this._renderMain(t, n, a, i, o), this._data = t.getData();
}, e.prototype.dispose = function() {
}, e.prototype._renderMain = function(t, n, a, i, o) {
var s = this.group, l = t.get("clockwise"), u = -t.get("startAngle") / 180 * Math.PI, h = -t.get("endAngle") / 180 * Math.PI, f = t.getModel("axisLine"), c = f.get("roundCap"), v = c ? of : Ge, p = f.get("show"), d = f.getModel("lineStyle"), g = d.get("width"), y = [u, h];
cy(y, !l), u = y[0], h = y[1];
for (var m = h - u, _ = u, S = [], x = 0; p && x < i.length; x++) {
var b = Math.min(Math.max(i[x][0], 0), 1);
h = u + m * b;
var w = new v({
shape: {
startAngle: _,
endAngle: h,
cx: o.cx,
cy: o.cy,
clockwise: l,
r0: o.r - g,
r: o.r
},
silent: !0
});
w.setStyle({
fill: i[x][1]
}), w.setStyle(d.getLineStyle(
// Because we use sector to simulate arc
// so the properties for stroking are useless
["color", "width"]
)), S.push(w), _ = h;
}
S.reverse(), A(S, function(C) {
return s.add(C);
});
var T = function(C) {
if (C <= 0)
return i[0][1];
var D;
for (D = 0; D < i.length; D++)
if (i[D][0] >= C && (D === 0 ? 0 : i[D - 1][0]) < C)
return i[D][1];
return i[D - 1][1];
};
this._renderTicks(t, n, a, T, o, u, h, l, g), this._renderTitleAndDetail(t, n, a, T, o), this._renderAnchor(t, o), this._renderPointer(t, n, a, T, o, u, h, l, g);
}, e.prototype._renderTicks = function(t, n, a, i, o, s, l, u, h) {
for (var f = this.group, c = o.cx, v = o.cy, p = o.r, d = +t.get("min"), g = +t.get("max"), y = t.getModel("splitLine"), m = t.getModel("axisTick"), _ = t.getModel("axisLabel"), S = t.get("splitNumber"), x = m.get("splitNumber"), b = W(y.get("length"), p), w = W(m.get("length"), p), T = s, C = (l - s) / S, D = C / x, M = y.getModel("lineStyle").getLineStyle(), I = m.getModel("lineStyle").getLineStyle(), L = y.get("distance"), E, P, k = 0; k <= S; k++) {
if (E = Math.cos(T), P = Math.sin(T), y.get("show")) {
var N = L ? L + h : h, R = new he({
shape: {
x1: E * (p - N) + c,
y1: P * (p - N) + v,
x2: E * (p - b - N) + c,
y2: P * (p - b - N) + v
},
style: M,
silent: !0
});
M.stroke === "auto" && R.setStyle({
stroke: i(k / S)
}), f.add(R);
}
if (_.get("show")) {
var N = _.get("distance") + L, V = Uu(jt(k / S * (g - d) + d), _.get("formatter")), F = i(k / S), H = E * (p - b - N) + c, $ = P * (p - b - N) + v, j = _.get("rotate"), Q = 0;
j === "radial" ? (Q = -T + 2 * Math.PI, Q > Math.PI / 2 && (Q += Math.PI)) : j === "tangential" ? Q = -T - Math.PI / 2 : Tt(j) && (Q = j * Math.PI / 180), Q === 0 ? f.add(new wt({
style: Gt(_, {
text: V,
x: H,
y: $,
verticalAlign: P < -0.8 ? "top" : P > 0.8 ? "bottom" : "middle",
align: E < -0.4 ? "left" : E > 0.4 ? "right" : "center"
}, {
inheritColor: F
}),
silent: !0
})) : f.add(new wt({
style: Gt(_, {
text: V,
x: H,
y: $,
verticalAlign: "middle",
align: "center"
}, {
inheritColor: F
}),
silent: !0,
originX: H,
originY: $,
rotation: Q
}));
}
if (m.get("show") && k !== S) {
var N = m.get("distance");
N = N ? N + h : h;
for (var st = 0; st <= x; st++) {
E = Math.cos(T), P = Math.sin(T);
var Et = new he({
shape: {
x1: E * (p - N) + c,
y1: P * (p - N) + v,
x2: E * (p - w - N) + c,
y2: P * (p - w - N) + v
},
silent: !0,
style: I
});
I.stroke === "auto" && Et.setStyle({
stroke: i((k + st / x) / S)
}), f.add(Et), T += D;
}
T -= D;
} else
T += C;
}
}, e.prototype._renderPointer = function(t, n, a, i, o, s, l, u, h) {
var f = this.group, c = this._data, v = this._progressEls, p = [], d = t.get(["pointer", "show"]), g = t.getModel("progress"), y = g.get("show"), m = t.getData(), _ = m.mapDimension("value"), S = +t.get("min"), x = +t.get("max"), b = [S, x], w = [s, l];
function T(D, M) {
var I = m.getItemModel(D), L = I.getModel("pointer"), E = W(L.get("width"), o.r), P = W(L.get("length"), o.r), k = t.get(["pointer", "icon"]), N = L.get("offsetCenter"), R = W(N[0], o.r), V = W(N[1], o.r), F = L.get("keepAspect"), H;
return k ? H = ae(k, R - E / 2, V - P, E, P, null, F) : H = new D4({
shape: {
angle: -Math.PI / 2,
width: E,
r: P,
x: R,
y: V
}
}), H.rotation = -(M + Math.PI / 2), H.x = o.cx, H.y = o.cy, H;
}
function C(D, M) {
var I = g.get("roundCap"), L = I ? of : Ge, E = g.get("overlap"), P = E ? g.get("width") : h / m.count(), k = E ? o.r - P : o.r - (D + 1) * P, N = E ? o.r : o.r - D * P, R = new L({
shape: {
startAngle: s,
endAngle: M,
cx: o.cx,
cy: o.cy,
clockwise: u,
r0: k,
r: N
}
});
return E && (R.z2 = Mt(m.get(_, D), [S, x], [100, 0], !0)), R;
}
(y || d) && (m.diff(c).add(function(D) {
var M = m.get(_, D);
if (d) {
var I = T(D, s);
$t(I, {
rotation: -((isNaN(+M) ? w[0] : Mt(M, b, w, !0)) + Math.PI / 2)
}, t), f.add(I), m.setItemGraphicEl(D, I);
}
if (y) {
var L = C(D, s), E = g.get("clip");
$t(L, {
shape: {
endAngle: Mt(M, b, w, E)
}
}, t), f.add(L), Td(t.seriesIndex, m.dataType, D, L), p[D] = L;
}
}).update(function(D, M) {
var I = m.get(_, D);
if (d) {
var L = c.getItemGraphicEl(M), E = L ? L.rotation : s, P = T(D, E);
P.rotation = E, Ct(P, {
rotation: -((isNaN(+I) ? w[0] : Mt(I, b, w, !0)) + Math.PI / 2)
}, t), f.add(P), m.setItemGraphicEl(D, P);
}
if (y) {
var k = v[M], N = k ? k.shape.endAngle : s, R = C(D, N), V = g.get("clip");
Ct(R, {
shape: {
endAngle: Mt(I, b, w, V)
}
}, t), f.add(R), Td(t.seriesIndex, m.dataType, D, R), p[D] = R;
}
}).execute(), m.each(function(D) {
var M = m.getItemModel(D), I = M.getModel("emphasis"), L = I.get("focus"), E = I.get("blurScope"), P = I.get("disabled");
if (d) {
var k = m.getItemGraphicEl(D), N = m.getItemVisual(D, "style"), R = N.fill;
if (k instanceof ge) {
var V = k.style;
k.useStyle(B({
image: V.image,
x: V.x,
y: V.y,
width: V.width,
height: V.height
}, N));
} else
k.useStyle(N), k.type !== "pointer" && k.setColor(R);
k.setStyle(M.getModel(["pointer", "itemStyle"]).getItemStyle()), k.style.fill === "auto" && k.setStyle("fill", i(Mt(m.get(_, D), b, [0, 1], !0))), k.z2EmphasisLift = 0, Se(k, M), Xt(k, L, E, P);
}
if (y) {
var F = p[D];
F.useStyle(m.getItemVisual(D, "style")), F.setStyle(M.getModel(["progress", "itemStyle"]).getItemStyle()), F.z2EmphasisLift = 0, Se(F, M), Xt(F, L, E, P);
}
}), this._progressEls = p);
}, e.prototype._renderAnchor = function(t, n) {
var a = t.getModel("anchor"), i = a.get("show");
if (i) {
var o = a.get("size"), s = a.get("icon"), l = a.get("offsetCenter"), u = a.get("keepAspect"), h = ae(s, n.cx - o / 2 + W(l[0], n.r), n.cy - o / 2 + W(l[1], n.r), o, o, null, u);
h.z2 = a.get("showAbove") ? 1 : 0, h.setStyle(a.getModel("itemStyle").getItemStyle()), this.group.add(h);
}
}, e.prototype._renderTitleAndDetail = function(t, n, a, i, o) {
var s = this, l = t.getData(), u = l.mapDimension("value"), h = +t.get("min"), f = +t.get("max"), c = new at(), v = [], p = [], d = t.isAnimationEnabled(), g = t.get(["pointer", "showAbove"]);
l.diff(this._data).add(function(y) {
v[y] = new wt({
silent: !0
}), p[y] = new wt({
silent: !0
});
}).update(function(y, m) {
v[y] = s._titleEls[m], p[y] = s._detailEls[m];
}).execute(), l.each(function(y) {
var m = l.getItemModel(y), _ = l.get(u, y), S = new at(), x = i(Mt(_, [h, f], [0, 1], !0)), b = m.getModel("title");
if (b.get("show")) {
var w = b.get("offsetCenter"), T = o.cx + W(w[0], o.r), C = o.cy + W(w[1], o.r), D = v[y];
D.attr({
z2: g ? 0 : 2,
style: Gt(b, {
x: T,
y: C,
text: l.getName(y),
align: "center",
verticalAlign: "middle"
}, {
inheritColor: x
})
}), S.add(D);
}
var M = m.getModel("detail");
if (M.get("show")) {
var I = M.get("offsetCenter"), L = o.cx + W(I[0], o.r), E = o.cy + W(I[1], o.r), P = W(M.get("width"), o.r), k = W(M.get("height"), o.r), N = t.get(["progress", "show"]) ? l.getItemVisual(y, "style").fill : x, D = p[y], R = M.get("formatter");
D.attr({
z2: g ? 0 : 2,
style: Gt(M, {
x: L,
y: E,
text: Uu(_, R),
width: isNaN(P) ? null : P,
height: isNaN(k) ? null : k,
align: "center",
verticalAlign: "middle"
}, {
inheritColor: N
})
}), oD(D, {
normal: M
}, _, function(F) {
return Uu(F, R);
}), d && sD(D, y, l, t, {
getFormattedLabel: function(F, H, $, j, Q, st) {
return Uu(st ? st.interpolatedValue : _, R);
}
}), S.add(D);
}
c.add(S);
}), this.group.add(c), this._titleEls = v, this._detailEls = p;
}, e.type = "gauge", e;
}(kt)
), I4 = (
/** @class */
function(r) {
O(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t.type = e.type, t.visualStyleAccessPath = "itemStyle", t;
}
return e.prototype.getInitialData = function(t, n) {
return jo(this, ["value"]);
}, e.type = "series.gauge", e.defaultOption = {
// zlevel: 0,
z: 2,
colorBy: "data",
// 默认全局居中
center: ["50%", "50%"],
legendHoverLink: !0,
radius: "75%",
startAngle: 225,
endAngle: -45,
clockwise: !0,
// 最小值
min: 0,
// 最大值
max: 100,
// 分割段数,默认为10
splitNumber: 10,
// 坐标轴线
axisLine: {
// 默认显示,属性show控制显示与否
show: !0,
roundCap: !1,
lineStyle: {
color: [[1, "#E6EBF8"]],
width: 10
}
},
// 坐标轴线
progress: {
// 默认显示,属性show控制显示与否
show: !1,
overlap: !0,
width: 10,
roundCap: !1,
clip: !0
},
// 分隔线
splitLine: {
// 默认显示,属性show控制显示与否
show: !0,
// 属性length控制线长
length: 10,
distance: 10,
// 属性lineStyle(详见lineStyle)控制线条样式
lineStyle: {
color: "#63677A",
width: 3,
type: "solid"
}
},
// 坐标轴小标记
axisTick: {
// 属性show控制显示与否,默认不显示
show: !0,
// 每份split细分多少段
splitNumber: 5,
// 属性length控制线长
length: 6,
distance: 10,
// 属性lineStyle控制线条样式
lineStyle: {
color: "#63677A",
width: 1,
type: "solid"
}
},
axisLabel: {
show: !0,
distance: 15,
// formatter: null,
color: "#464646",
fontSize: 12,
rotate: 0
},
pointer: {
icon: null,
offsetCenter: [0, 0],
show: !0,
showAbove: !0,
length: "60%",
width: 6,
keepAspect: !1
},
anchor: {
show: !1,
showAbove: !1,
size: 6,
icon: "circle",
offsetCenter: [0, 0],
keepAspect: !1,
itemStyle: {
color: "#fff",
borderWidth: 0,
borderColor: "#5470c6"
}
},
title: {
show: !0,
// x, y,单位px
offsetCenter: [0, "20%"],
// 其余属性默认使用全局文本样式,详见TEXTSTYLE
color: "#464646",
fontSize: 16,
valueAnimation: !1
},
detail: {
show: !0,
backgroundColor: "rgba(0,0,0,0)",
borderWidth: 0,
borderColor: "#ccc",
width: 100,
height: null,
padding: [5, 10],
// x, y,单位px
offsetCenter: [0, "40%"],
// formatter: null,
// 其余属性默认使用全局文本样式,详见TEXTSTYLE
color: "#464646",
fontSize: 30,
fontWeight: "bold",
lineHeight: 30,
valueAnimation: !1
}
}, e;
}(Ft)
);
function L4(r) {
r.registerChartView(M4), r.registerSeriesModel(I4);
}
var E4 = ["itemStyle", "opacity"], P4 = (
/** @class */
function(r) {
O(e, r);
function e(t, n) {
var a = r.call(this) || this, i = a, o = new He(), s = new wt();
return i.setTextContent(s), a.setTextGuideLine(o), a.updateData(t, n, !0), a;
}
return e.prototype.updateData = function(t, n, a) {
var i = this, o = t.hostModel, s = t.getItemModel(n), l = t.getItemLayout(n), u = s.getModel("emphasis"), h = s.get(E4);
h = h ?? 1, a || Or(i), i.useStyle(t.getItemVisual(n, "style")), i.style.lineJoin = "round", a ? (i.setShape({
points: l.points
}), i.style.opacity = 0, $t(i, {
style: {
opacity: h
}
}, o, n)) : Ct(i, {
style: {
opacity: h
},
shape: {
points: l.points
}
}, o, n), Se(i, s), this._updateLabel(t, n), Xt(this, u.get("focus"), u.get("blurScope"), u.get("disabled"));
}, e.prototype._updateLabel = function(t, n) {
var a = this, i = this.getTextGuideLine(), o = a.getTextContent(), s = t.hostModel, l = t.getItemModel(n), u = t.getItemLayout(n), h = u.label, f = t.getItemVisual(n, "style"), c = f.fill;
xe(
// position will not be used in setLabelStyle
o,
ve(l),
{
labelFetcher: t.hostModel,
labelDataIndex: n,
defaultOpacity: f.opacity,
defaultText: t.getName(n)
},
{
normal: {
align: h.textAlign,
verticalAlign: h.verticalAlign
}
}
), a.setTextConfig({
local: !0,
inside: !!h.inside,
insideStroke: c,
// insideFill: 'auto',
outsideFill: c
});
var v = h.linePoints;
i.setShape({
points: v
}), a.textGuideLineConfig = {
anchor: v ? new ft(v[0][0], v[0][1]) : null
}, Ct(o, {
style: {
x: h.x,
y: h.y
}
}, s, n), o.attr({
rotation: h.rotation,
originX: h.x,
originY: h.y,
z2: 10
}), Ky(a, jy(l), {
// Default use item visual color
stroke: c
});
}, e;
}(Fe)
), k4 = (
/** @class */
function(r) {
O(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t.type = e.type, t.ignoreLabelLineUpdate = !0, t;
}
return e.prototype.render = function(t, n, a) {
var i = t.getData(), o = this._data, s = this.group;
i.diff(o).add(function(l) {
var u = new P4(i, l);
i.setItemGraphicEl(l, u), s.add(u);
}).update(function(l, u) {
var h = o.getItemGraphicEl(u);
h.updateData(i, l), s.add(h), i.setItemGraphicEl(l, h);
}).remove(function(l) {
var u = o.getItemGraphicEl(l);
cl(u, t, l);
}).execute(), this._data = i;
}, e.prototype.remove = function() {
this.group.removeAll(), this._data = null;
}, e.prototype.dispose = function() {
}, e.type = "funnel", e;
}(kt)
), R4 = (
/** @class */
function(r) {
O(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t.type = e.type, t;
}
return e.prototype.init = function(t) {
r.prototype.init.apply(this, arguments), this.legendVisualProvider = new jl(Y(this.getData, this), Y(this.getRawData, this)), this._defaultLabelLine(t);
}, e.prototype.getInitialData = function(t, n) {
return jo(this, {
coordDimensions: ["value"],
encodeDefaulter: ut(Iy, this)
});
}, e.prototype._defaultLabelLine = function(t) {
xi(t, "labelLine", ["show"]);
var n = t.labelLine, a = t.emphasis.labelLine;
n.show = n.show && t.label.show, a.show = a.show && t.emphasis.label.show;
}, e.prototype.getDataParams = function(t) {
var n = this.getData(), a = r.prototype.getDataParams.call(this, t), i = n.mapDimension("value"), o = n.getSum(i);
return a.percent = o ? +(n.get(i, t) / o * 100).toFixed(2) : 0, a.$vars.push("percent"), a;
}, e.type = "series.funnel", e.defaultOption = {
// zlevel: 0, // 一级层叠
z: 2,
legendHoverLink: !0,
colorBy: "data",
left: 80,
top: 60,
right: 80,
bottom: 60,
// width: {totalWidth} - left - right,
// height: {totalHeight} - top - bottom,
// 默认取数据最小最大值
// min: 0,
// max: 100,
minSize: "0%",
maxSize: "100%",
sort: "descending",
orient: "vertical",
gap: 0,
funnelAlign: "center",
label: {
show: !0,
position: "outer"
// formatter: 标签文本格式器,同Tooltip.formatter,不支持异步回调
},
labelLine: {
show: !0,
length: 20,
lineStyle: {
// color: 各异,
width: 1
}
},
itemStyle: {
// color: 各异,
borderColor: "#fff",
borderWidth: 1
},
emphasis: {
label: {
show: !0
}
},
select: {
itemStyle: {
borderColor: "#212121"
}
}
}, e;
}(Ft)
);
function N4(r, e) {
return se(r.getBoxLayoutParams(), {
width: e.getWidth(),
height: e.getHeight()
});
}
function O4(r, e) {
for (var t = r.mapDimension("value"), n = r.mapArray(t, function(l) {
return l;
}), a = [], i = e === "ascending", o = 0, s = r.count(); o < s; o++)
a[o] = o;
return K(e) ? a.sort(e) : e !== "none" && a.sort(function(l, u) {
return i ? n[l] - n[u] : n[u] - n[l];
}), a;
}
function V4(r) {
var e = r.hostModel, t = e.get("orient");
r.each(function(n) {
var a = r.getItemModel(n), i = a.getModel("label"), o = i.get("position"), s = a.getModel("labelLine"), l = r.getItemLayout(n), u = l.points, h = o === "inner" || o === "inside" || o === "center" || o === "insideLeft" || o === "insideRight", f, c, v, p;
if (h)
o === "insideLeft" ? (c = (u[0][0] + u[3][0]) / 2 + 5, v = (u[0][1] + u[3][1]) / 2, f = "left") : o === "insideRight" ? (c = (u[1][0] + u[2][0]) / 2 - 5, v = (u[1][1] + u[2][1]) / 2, f = "right") : (c = (u[0][0] + u[1][0] + u[2][0] + u[3][0]) / 4, v = (u[0][1] + u[1][1] + u[2][1] + u[3][1]) / 4, f = "center"), p = [[c, v], [c, v]];
else {
var d = void 0, g = void 0, y = void 0, m = void 0, _ = s.get("length");
process.env.NODE_ENV !== "production" && (t === "vertical" && ["top", "bottom"].indexOf(o) > -1 && (o = "left", console.warn("Position error: Funnel chart on vertical orient dose not support top and bottom.")), t === "horizontal" && ["left", "right"].indexOf(o) > -1 && (o = "bottom", console.warn("Position error: Funnel chart on horizontal orient dose not support left and right."))), o === "left" ? (d = (u[3][0] + u[0][0]) / 2, g = (u[3][1] + u[0][1]) / 2, y = d - _, c = y - 5, f = "right") : o === "right" ? (d = (u[1][0] + u[2][0]) / 2, g = (u[1][1] + u[2][1]) / 2, y = d + _, c = y + 5, f = "left") : o === "top" ? (d = (u[3][0] + u[0][0]) / 2, g = (u[3][1] + u[0][1]) / 2, m = g - _, v = m - 5, f = "center") : o === "bottom" ? (d = (u[1][0] + u[2][0]) / 2, g = (u[1][1] + u[2][1]) / 2, m = g + _, v = m + 5, f = "center") : o === "rightTop" ? (d = t === "horizontal" ? u[3][0] : u[1][0], g = t === "horizontal" ? u[3][1] : u[1][1], t === "horizontal" ? (m = g - _, v = m - 5, f = "center") : (y = d + _, c = y + 5, f = "top")) : o === "rightBottom" ? (d = u[2][0], g = u[2][1], t === "horizontal" ? (m = g + _, v = m + 5, f = "center") : (y = d + _, c = y + 5, f = "bottom")) : o === "leftTop" ? (d = u[0][0], g = t === "horizontal" ? u[0][1] : u[1][1], t === "horizontal" ? (m = g - _, v = m - 5, f = "center") : (y = d - _, c = y - 5, f = "right")) : o === "leftBottom" ? (d = t === "horizontal" ? u[1][0] : u[3][0], g = t === "horizontal" ? u[1][1] : u[2][1], t === "horizontal" ? (m = g + _, v = m + 5, f = "center") : (y = d - _, c = y - 5, f = "right")) : (d = (u[1][0] + u[2][0]) / 2, g = (u[1][1] + u[2][1]) / 2, t === "horizontal" ? (m = g + _, v = m + 5, f = "center") : (y = d + _, c = y + 5, f = "left")), t === "horizontal" ? (y = d, c = y) : (m = g, v = m), p = [[d, g], [y, m]];
}
l.label = {
linePoints: p,
x: c,
y: v,
verticalAlign: "middle",
textAlign: f,
inside: h
};
});
}
function B4(r, e) {
r.eachSeriesByType("funnel", function(t) {
var n = t.getData(), a = n.mapDimension("value"), i = t.get("sort"), o = N4(t, e), s = t.get("orient"), l = o.width, u = o.height, h = O4(n, i), f = o.x, c = o.y, v = s === "horizontal" ? [W(t.get("minSize"), u), W(t.get("maxSize"), u)] : [W(t.get("minSize"), l), W(t.get("maxSize"), l)], p = n.getDataExtent(a), d = t.get("min"), g = t.get("max");
d == null && (d = Math.min(p[0], 0)), g == null && (g = p[1]);
var y = t.get("funnelAlign"), m = t.get("gap"), _ = s === "horizontal" ? l : u, S = (_ - m * (n.count() - 1)) / n.count(), x = function(E, P) {
if (s === "horizontal") {
var k = n.get(a, E) || 0, N = Mt(k, [d, g], v, !0), R = void 0;
switch (y) {
case "top":
R = c;
break;
case "center":
R = c + (u - N) / 2;
break;
case "bottom":
R = c + (u - N);
break;
}
return [[P, R], [P, R + N]];
}
var V = n.get(a, E) || 0, F = Mt(V, [d, g], v, !0), H;
switch (y) {
case "left":
H = f;
break;
case "center":
H = f + (l - F) / 2;
break;
case "right":
H = f + l - F;
break;
}
return [[H, P], [H + F, P]];
};
i === "ascending" && (S = -S, m = -m, s === "horizontal" ? f += l : c += u, h = h.reverse());
for (var b = 0; b < h.length; b++) {
var w = h[b], T = h[b + 1], C = n.getItemModel(w);
if (s === "horizontal") {
var D = C.get(["itemStyle", "width"]);
D == null ? D = S : (D = W(D, l), i === "ascending" && (D = -D));
var M = x(w, f), I = x(T, f + D);
f += D + m, n.setItemLayout(w, {
points: M.concat(I.slice().reverse())
});
} else {
var L = C.get(["itemStyle", "height"]);
L == null ? L = S : (L = W(L, u), i === "ascending" && (L = -L));
var M = x(w, c), I = x(T, c + L);
c += L + m, n.setItemLayout(w, {
points: M.concat(I.slice().reverse())
});
}
}
V4(n);
});
}
function z4(r) {
r.registerChartView(k4), r.registerSeriesModel(R4), r.registerLayout(B4), r.registerProcessor(Kl("funnel"));
}
var G4 = 0.3, F4 = (
/** @class */
function(r) {
O(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t.type = e.type, t._dataGroup = new at(), t._initialized = !1, t;
}
return e.prototype.init = function() {
this.group.add(this._dataGroup);
}, e.prototype.render = function(t, n, a, i) {
this._progressiveEls = null;
var o = this._dataGroup, s = t.getData(), l = this._data, u = t.coordinateSystem, h = u.dimensions, f = Hx(t);
s.diff(l).add(c).update(v).remove(p).execute();
function c(g) {
var y = Fx(s, o, g, h, u);
hp(y, s, g, f);
}
function v(g, y) {
var m = l.getItemGraphicEl(y), _ = E2(s, g, h, u);
s.setItemGraphicEl(g, m), Ct(m, {
shape: {
points: _
}
}, t, g), Or(m), hp(m, s, g, f);
}
function p(g) {
var y = l.getItemGraphicEl(g);
o.remove(y);
}
if (!this._initialized) {
this._initialized = !0;
var d = H4(u, t, function() {
setTimeout(function() {
o.removeClipPath();
});
});
o.setClipPath(d);
}
this._data = s;
}, e.prototype.incrementalPrepareRender = function(t, n, a) {
this._initialized = !0, this._data = null, this._dataGroup.removeAll();
}, e.prototype.incrementalRender = function(t, n, a) {
for (var i = n.getData(), o = n.coordinateSystem, s = o.dimensions, l = Hx(n), u = this._progressiveEls = [], h = t.start; h < t.end; h++) {
var f = Fx(i, this._dataGroup, h, s, o);
f.incremental = !0, hp(f, i, h, l), u.push(f);
}
}, e.prototype.remove = function() {
this._dataGroup && this._dataGroup.removeAll(), this._data = null;
}, e.type = "parallel", e;
}(kt)
);
function H4(r, e, t) {
var n = r.model, a = r.getRect(), i = new xt({
shape: {
x: a.x,
y: a.y,
width: a.width,
height: a.height
}
}), o = n.get("layout") === "horizontal" ? "width" : "height";
return i.setShape(o, 0), $t(i, {
shape: {
width: a.width,
height: a.height
}
}, e, t), i;
}
function E2(r, e, t, n) {
for (var a = [], i = 0; i < t.length; i++) {
var o = t[i], s = r.get(r.mapDimension(o), e);
W4(s, n.getAxis(o).type) || a.push(n.dataToPoint(s, o));
}
return a;
}
function Fx(r, e, t, n, a) {
var i = E2(r, t, n, a), o = new He({
shape: {
points: i
},
// silent: true,
z2: 10
});
return e.add(o), r.setItemGraphicEl(t, o), o;
}
function Hx(r) {
var e = r.get("smooth", !0);
return e === !0 && (e = G4), e = An(e), Si(e) && (e = 0), {
smooth: e
};
}
function hp(r, e, t, n) {
r.useStyle(e.getItemVisual(t, "style")), r.style.fill = null, r.setShape("smooth", n.smooth);
var a = e.getItemModel(t), i = a.getModel("emphasis");
Se(r, a, "lineStyle"), Xt(r, i.get("focus"), i.get("blurScope"), i.get("disabled"));
}
function W4(r, e) {
return e === "category" ? r == null : r == null || isNaN(r);
}
var $4 = (
/** @class */
function(r) {
O(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t.type = e.type, t.visualStyleAccessPath = "lineStyle", t.visualDrawType = "stroke", t;
}
return e.prototype.getInitialData = function(t, n) {
return On(null, this, {
useEncodeDefaulter: Y(U4, null, this)
});
}, e.prototype.getRawIndicesByActiveState = function(t) {
var n = this.coordinateSystem, a = this.getData(), i = [];
return n.eachActiveState(a, function(o, s) {
t === o && i.push(a.getRawIndex(s));
}), i;
}, e.type = "series.parallel", e.dependencies = ["parallel"], e.defaultOption = {
// zlevel: 0,
z: 2,
coordinateSystem: "parallel",
parallelIndex: 0,
label: {
show: !1
},
inactiveOpacity: 0.05,
activeOpacity: 1,
lineStyle: {
width: 1,
opacity: 0.45,
type: "solid"
},
emphasis: {
label: {
show: !1
}
},
progressive: 500,
smooth: !1,
animationEasing: "linear"
}, e;
}(Ft)
);
function U4(r) {
var e = r.ecModel.getComponent("parallel", r.get("parallelIndex"));
if (e) {
var t = {};
return A(e.dimensions, function(n) {
var a = Y4(n);
t[n] = a;
}), t;
}
}
function Y4(r) {
return +r.replace("dim", "");
}
var Z4 = ["lineStyle", "opacity"], X4 = {
seriesType: "parallel",
reset: function(r, e) {
var t = r.coordinateSystem, n = {
normal: r.get(["lineStyle", "opacity"]),
active: r.get("activeOpacity"),
inactive: r.get("inactiveOpacity")
};
return {
progress: function(a, i) {
t.eachActiveState(i, function(o, s) {
var l = n[o];
if (o === "normal" && i.hasItemOption) {
var u = i.getItemModel(s).get(Z4, !0);
u != null && (l = u);
}
var h = i.ensureUniqueItemVisual(s, "style");
h.opacity = l;
}, a.start, a.end);
}
};
}
};
function q4(r) {
K4(r), j4(r);
}
function K4(r) {
if (!r.parallel) {
var e = !1;
A(r.series, function(t) {
t && t.type === "parallel" && (e = !0);
}), e && (r.parallel = [{}]);
}
}
function j4(r) {
var e = Pt(r.parallelAxis);
A(e, function(t) {
if (J(t)) {
var n = t.parallelIndex || 0, a = Pt(r.parallel)[n];
a && a.parallelAxisDefault && ht(t, a.parallelAxisDefault, !1);
}
});
}
var Q4 = 5, J4 = (
/** @class */
function(r) {
O(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t.type = e.type, t;
}
return e.prototype.render = function(t, n, a) {
this._model = t, this._api = a, this._handlers || (this._handlers = {}, A(tH, function(i, o) {
a.getZr().on(o, this._handlers[o] = Y(i, this));
}, this)), Xo(this, "_throttledDispatchExpand", t.get("axisExpandRate"), "fixRate");
}, e.prototype.dispose = function(t, n) {
gl(this, "_throttledDispatchExpand"), A(this._handlers, function(a, i) {
n.getZr().off(i, a);
}), this._handlers = null;
}, e.prototype._throttledDispatchExpand = function(t) {
this._dispatchExpand(t);
}, e.prototype._dispatchExpand = function(t) {
t && this._api.dispatchAction(B({
type: "parallelAxisExpand"
}, t));
}, e.type = "parallel", e;
}(Yt)
), tH = {
mousedown: function(r) {
fp(this, "click") && (this._mouseDownPoint = [r.offsetX, r.offsetY]);
},
mouseup: function(r) {
var e = this._mouseDownPoint;
if (fp(this, "click") && e) {
var t = [r.offsetX, r.offsetY], n = Math.pow(e[0] - t[0], 2) + Math.pow(e[1] - t[1], 2);
if (n > Q4)
return;
var a = this._model.coordinateSystem.getSlidedAxisExpandWindow([r.offsetX, r.offsetY]);
a.behavior !== "none" && this._dispatchExpand({
axisExpandWindow: a.axisExpandWindow
});
}
this._mouseDownPoint = null;
},
mousemove: function(r) {
if (!(this._mouseDownPoint || !fp(this, "mousemove"))) {
var e = this._model, t = e.coordinateSystem.getSlidedAxisExpandWindow([r.offsetX, r.offsetY]), n = t.behavior;
n === "jump" && this._throttledDispatchExpand.debounceNextCall(e.get("axisExpandDebounce")), this._throttledDispatchExpand(n === "none" ? null : {
axisExpandWindow: t.axisExpandWindow,
// Jumping uses animation, and sliding suppresses animation.
animation: n === "jump" ? null : {
duration: 0
// Disable animation.
}
});
}
}
};
function fp(r, e) {
var t = r._model;
return t.get("axisExpandable") && t.get("axisExpandTriggerOn") === e;
}
var eH = (
/** @class */
function(r) {
O(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t.type = e.type, t;
}
return e.prototype.init = function() {
r.prototype.init.apply(this, arguments), this.mergeOption({});
}, e.prototype.mergeOption = function(t) {
var n = this.option;
t && ht(n, t, !0), this._initDimensions();
}, e.prototype.contains = function(t, n) {
var a = t.get("parallelIndex");
return a != null && n.getComponent("parallel", a) === this;
}, e.prototype.setAxisExpand = function(t) {
A(["axisExpandable", "axisExpandCenter", "axisExpandCount", "axisExpandWidth", "axisExpandWindow"], function(n) {
t.hasOwnProperty(n) && (this.option[n] = t[n]);
}, this);
}, e.prototype._initDimensions = function() {
var t = this.dimensions = [], n = this.parallelAxisIndex = [], a = At(this.ecModel.queryComponents({
mainType: "parallelAxis"
}), function(i) {
return (i.get("parallelIndex") || 0) === this.componentIndex;
}, this);
A(a, function(i) {
t.push("dim" + i.get("dim")), n.push(i.componentIndex);
});
}, e.type = "parallel", e.dependencies = ["parallelAxis"], e.layoutMode = "box", e.defaultOption = {
// zlevel: 0,
z: 0,
left: 80,
top: 60,
right: 80,
bottom: 60,
// width: {totalWidth} - left - right,
// height: {totalHeight} - top - bottom,
layout: "horizontal",
// FIXME
// naming?
axisExpandable: !1,
axisExpandCenter: null,
axisExpandCount: 0,
axisExpandWidth: 50,
axisExpandRate: 17,
axisExpandDebounce: 50,
// [out, in, jumpTarget]. In percentage. If use [null, 0.05], null means full.
// Do not doc to user until necessary.
axisExpandSlideTriggerArea: [-0.15, 0.05, 0.4],
axisExpandTriggerOn: "click",
parallelAxisDefault: null
}, e;
}(_t)
), rH = (
/** @class */
function(r) {
O(e, r);
function e(t, n, a, i, o) {
var s = r.call(this, t, n, a) || this;
return s.type = i || "value", s.axisIndex = o, s;
}
return e.prototype.isHorizontal = function() {
return this.coordinateSystem.getModel().get("layout") !== "horizontal";
}, e;
}(Br)
);
function Vi(r, e, t, n, a, i) {
r = r || 0;
var o = t[1] - t[0];
if (a != null && (a = ro(a, [0, o])), i != null && (i = Math.max(i, a ?? 0)), n === "all") {
var s = Math.abs(e[1] - e[0]);
s = ro(s, [0, o]), a = i = ro(s, [a, i]), n = 0;
}
e[0] = ro(e[0], t), e[1] = ro(e[1], t);
var l = cp(e, n);
e[n] += r;
var u = a || 0, h = t.slice();
l.sign < 0 ? h[0] += u : h[1] -= u, e[n] = ro(e[n], h);
var f;
return f = cp(e, n), a != null && (f.sign !== l.sign || f.span < a) && (e[1 - n] = e[n] + l.sign * a), f = cp(e, n), i != null && f.span > i && (e[1 - n] = e[n] + f.sign * i), e;
}
function cp(r, e) {
var t = r[e] - r[1 - e];
return {
span: Math.abs(t),
sign: t > 0 ? -1 : t < 0 ? 1 : e ? -1 : 1
};
}
function ro(r, e) {
return Math.min(e[1] != null ? e[1] : 1 / 0, Math.max(e[0] != null ? e[0] : -1 / 0, r));
}
var vp = A, P2 = Math.min, k2 = Math.max, Wx = Math.floor, nH = Math.ceil, $x = jt, aH = Math.PI, iH = (
/** @class */
function() {
function r(e, t, n) {
this.type = "parallel", this._axesMap = X(), this._axesLayout = {}, this.dimensions = e.dimensions, this._model = e, this._init(e, t, n);
}
return r.prototype._init = function(e, t, n) {
var a = e.dimensions, i = e.parallelAxisIndex;
vp(a, function(o, s) {
var l = i[s], u = t.getComponent("parallelAxis", l), h = this._axesMap.set(o, new rH(o, hc(u), [0, 0], u.get("type"), l)), f = h.type === "category";
h.onBand = f && u.get("boundaryGap"), h.inverse = u.get("inverse"), u.axis = h, h.model = u, h.coordinateSystem = u.coordinateSystem = this;
}, this);
}, r.prototype.update = function(e, t) {
this._updateAxesFromSeries(this._model, e);
}, r.prototype.containPoint = function(e) {
var t = this._makeLayoutInfo(), n = t.axisBase, a = t.layoutBase, i = t.pixelDimIndex, o = e[1 - i], s = e[i];
return o >= n && o <= n + t.axisLength && s >= a && s <= a + t.layoutLength;
}, r.prototype.getModel = function() {
return this._model;
}, r.prototype._updateAxesFromSeries = function(e, t) {
t.eachSeries(function(n) {
if (e.contains(n, t)) {
var a = n.getData();
vp(this.dimensions, function(i) {
var o = this._axesMap.get(i);
o.scale.unionExtentFromData(a, a.mapDimension(i)), Io(o.scale, o.model);
}, this);
}
}, this);
}, r.prototype.resize = function(e, t) {
this._rect = se(e.getBoxLayoutParams(), {
width: t.getWidth(),
height: t.getHeight()
}), this._layoutAxes();
}, r.prototype.getRect = function() {
return this._rect;
}, r.prototype._makeLayoutInfo = function() {
var e = this._model, t = this._rect, n = ["x", "y"], a = ["width", "height"], i = e.get("layout"), o = i === "horizontal" ? 0 : 1, s = t[a[o]], l = [0, s], u = this.dimensions.length, h = Yu(e.get("axisExpandWidth"), l), f = Yu(e.get("axisExpandCount") || 0, [0, u]), c = e.get("axisExpandable") && u > 3 && u > f && f > 1 && h > 0 && s > 0, v = e.get("axisExpandWindow"), p;
if (v)
p = Yu(v[1] - v[0], l), v[1] = v[0] + p;
else {
p = Yu(h * (f - 1), l);
var d = e.get("axisExpandCenter") || Wx(u / 2);
v = [h * d - p / 2], v[1] = v[0] + p;
}
var g = (s - p) / (u - f);
g < 3 && (g = 0);
var y = [Wx($x(v[0] / h, 1)) + 1, nH($x(v[1] / h, 1)) - 1], m = g / h * v[0];
return {
layout: i,
pixelDimIndex: o,
layoutBase: t[n[o]],
layoutLength: s,
axisBase: t[n[1 - o]],
axisLength: t[a[1 - o]],
axisExpandable: c,
axisExpandWidth: h,
axisCollapseWidth: g,
axisExpandWindow: v,
axisCount: u,
winInnerIndices: y,
axisExpandWindow0Pos: m
};
}, r.prototype._layoutAxes = function() {
var e = this._rect, t = this._axesMap, n = this.dimensions, a = this._makeLayoutInfo(), i = a.layout;
t.each(function(o) {
var s = [0, a.axisLength], l = o.inverse ? 1 : 0;
o.setExtent(s[l], s[1 - l]);
}), vp(n, function(o, s) {
var l = (a.axisExpandable ? sH : oH)(s, a), u = {
horizontal: {
x: l.position,
y: a.axisLength
},
vertical: {
x: 0,
y: l.position
}
}, h = {
horizontal: aH / 2,
vertical: 0
}, f = [u[i].x + e.x, u[i].y + e.y], c = h[i], v = tr();
Li(v, v, c), nn(v, v, f), this._axesLayout[o] = {
position: f,
rotation: c,
transform: v,
axisNameAvailableWidth: l.axisNameAvailableWidth,
axisLabelShow: l.axisLabelShow,
nameTruncateMaxWidth: l.nameTruncateMaxWidth,
tickDirection: 1,
labelDirection: 1
};
}, this);
}, r.prototype.getAxis = function(e) {
return this._axesMap.get(e);
}, r.prototype.dataToPoint = function(e, t) {
return this.axisCoordToPoint(this._axesMap.get(t).dataToCoord(e), t);
}, r.prototype.eachActiveState = function(e, t, n, a) {
n == null && (n = 0), a == null && (a = e.count());
var i = this._axesMap, o = this.dimensions, s = [], l = [];
A(o, function(g) {
s.push(e.mapDimension(g)), l.push(i.get(g).model);
});
for (var u = this.hasAxisBrushed(), h = n; h < a; h++) {
var f = void 0;
if (!u)
f = "normal";
else {
f = "active";
for (var c = e.getValues(s, h), v = 0, p = o.length; v < p; v++) {
var d = l[v].getActiveState(c[v]);
if (d === "inactive") {
f = "inactive";
break;
}
}
}
t(f, h);
}
}, r.prototype.hasAxisBrushed = function() {
for (var e = this.dimensions, t = this._axesMap, n = !1, a = 0, i = e.length; a < i; a++)
t.get(e[a]).model.getActiveState() !== "normal" && (n = !0);
return n;
}, r.prototype.axisCoordToPoint = function(e, t) {
var n = this._axesLayout[t];
return kr([e, 0], n.transform);
}, r.prototype.getAxisLayout = function(e) {
return nt(this._axesLayout[e]);
}, r.prototype.getSlidedAxisExpandWindow = function(e) {
var t = this._makeLayoutInfo(), n = t.pixelDimIndex, a = t.axisExpandWindow.slice(), i = a[1] - a[0], o = [0, t.axisExpandWidth * (t.axisCount - 1)];
if (!this.containPoint(e))
return {
behavior: "none",
axisExpandWindow: a
};
var s = e[n] - t.layoutBase - t.axisExpandWindow0Pos, l, u = "slide", h = t.axisCollapseWidth, f = this._model.get("axisExpandSlideTriggerArea"), c = f[0] != null;
if (h)
c && h && s < i * f[0] ? (u = "jump", l = s - i * f[2]) : c && h && s > i * (1 - f[0]) ? (u = "jump", l = s - i * (1 - f[2])) : (l = s - i * f[1]) >= 0 && (l = s - i * (1 - f[1])) <= 0 && (l = 0), l *= t.axisExpandWidth / h, l ? Vi(l, a, o, "all") : u = "none";
else {
var v = a[1] - a[0], p = o[1] * s / v;
a = [k2(0, p - v / 2)], a[1] = P2(o[1], a[0] + v), a[0] = a[1] - v;
}
return {
axisExpandWindow: a,
behavior: u
};
}, r;
}()
);
function Yu(r, e) {
return P2(k2(r, e[0]), e[1]);
}
function oH(r, e) {
var t = e.layoutLength / (e.axisCount - 1);
return {
position: t * r,
axisNameAvailableWidth: t,
axisLabelShow: !0
};
}
function sH(r, e) {
var t = e.layoutLength, n = e.axisExpandWidth, a = e.axisCount, i = e.axisCollapseWidth, o = e.winInnerIndices, s, l = i, u = !1, h;
return r < o[0] ? (s = r * i, h = i) : r <= o[1] ? (s = e.axisExpandWindow0Pos + r * n - e.axisExpandWindow[0], l = n, u = !0) : (s = t - (a - 1 - r) * i, h = i), {
position: s,
axisNameAvailableWidth: l,
axisLabelShow: u,
nameTruncateMaxWidth: h
};
}
function lH(r, e) {
var t = [];
return r.eachComponent("parallel", function(n, a) {
var i = new iH(n, r, e);
i.name = "parallel_" + a, i.resize(n, e), n.coordinateSystem = i, i.model = n, t.push(i);
}), r.eachSeries(function(n) {
if (n.get("coordinateSystem") === "parallel") {
var a = n.getReferringComponents("parallel", ne).models[0];
n.coordinateSystem = a.coordinateSystem;
}
}), t;
}
var uH = {
create: lH
}, dg = (
/** @class */
function(r) {
O(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t.type = e.type, t.activeIntervals = [], t;
}
return e.prototype.getAreaSelectStyle = function() {
return wi([
["fill", "color"],
["lineWidth", "borderWidth"],
["stroke", "borderColor"],
["width", "width"],
["opacity", "opacity"]
// Option decal is in `DecalObject` but style.decal is in `PatternObject`.
// So do not transfer decal directly.
])(this.getModel("areaSelectStyle"));
}, e.prototype.setActiveIntervals = function(t) {
var n = this.activeIntervals = nt(t);
if (n)
for (var a = n.length - 1; a >= 0; a--)
yr(n[a]);
}, e.prototype.getActiveState = function(t) {
var n = this.activeIntervals;
if (!n.length)
return "normal";
if (t == null || isNaN(+t))
return "inactive";
if (n.length === 1) {
var a = n[0];
if (a[0] <= t && t <= a[1])
return "active";
} else
for (var i = 0, o = n.length; i < o; i++)
if (n[i][0] <= t && t <= n[i][1])
return "active";
return "inactive";
}, e;
}(_t)
);
ie(dg, Ul);
var Di = !0, Ml = Math.min, Po = Math.max, hH = Math.pow, fH = 1e4, cH = 6, vH = 6, Ux = "globalPan", pH = {
w: [0, 0],
e: [0, 1],
n: [1, 0],
s: [1, 1]
}, dH = {
w: "ew",
e: "ew",
n: "ns",
s: "ns",
ne: "nesw",
sw: "nesw",
nw: "nwse",
se: "nwse"
}, Yx = {
brushStyle: {
lineWidth: 2,
stroke: "rgba(210,219,238,0.3)",
fill: "#D2DBEE"
},
transformable: !0,
brushMode: "single",
removeOnClick: !1
}, gH = 0, Sm = (
/** @class */
function(r) {
O(e, r);
function e(t) {
var n = r.call(this) || this;
return n._track = [], n._covers = [], n._handlers = {}, process.env.NODE_ENV !== "production" && tt(t), n._zr = t, n.group = new at(), n._uid = "brushController_" + gH++, A(wH, function(a, i) {
this._handlers[i] = Y(a, this);
}, n), n;
}
return e.prototype.enableBrush = function(t) {
return process.env.NODE_ENV !== "production" && tt(this._mounted), this._brushType && this._doDisableBrush(), t.brushType && this._doEnableBrush(t), this;
}, e.prototype._doEnableBrush = function(t) {
var n = this._zr;
this._enableGlobalPan || oG(n, Ux, this._uid), A(this._handlers, function(a, i) {
n.on(i, a);
}), this._brushType = t.brushType, this._brushOption = ht(nt(Yx), t, !0);
}, e.prototype._doDisableBrush = function() {
var t = this._zr;
sG(t, Ux, this._uid), A(this._handlers, function(n, a) {
t.off(a, n);
}), this._brushType = this._brushOption = null;
}, e.prototype.setPanels = function(t) {
if (t && t.length) {
var n = this._panels = {};
A(t, function(a) {
n[a.panelId] = nt(a);
});
} else
this._panels = null;
return this;
}, e.prototype.mount = function(t) {
t = t || {}, process.env.NODE_ENV !== "production" && (this._mounted = !0), this._enableGlobalPan = t.enableGlobalPan;
var n = this.group;
return this._zr.add(n), n.attr({
x: t.x || 0,
y: t.y || 0,
rotation: t.rotation || 0,
scaleX: t.scaleX || 1,
scaleY: t.scaleY || 1
}), this._transform = n.getLocalTransform(), this;
}, e.prototype.updateCovers = function(t) {
process.env.NODE_ENV !== "production" && tt(this._mounted), t = G(t, function(c) {
return ht(nt(Yx), c, !0);
});
var n = "\0-brush-index-", a = this._covers, i = this._covers = [], o = this, s = this._creatingCover;
return new Ln(a, t, u, l).add(h).update(h).remove(f).execute(), this;
function l(c, v) {
return (c.id != null ? c.id : n + v) + "-" + c.brushType;
}
function u(c, v) {
return l(c.__brushOption, v);
}
function h(c, v) {
var p = t[c];
if (v != null && a[v] === s)
i[c] = a[v];
else {
var d = i[c] = v != null ? (a[v].__brushOption = p, a[v]) : N2(o, R2(o, p));
xm(o, d);
}
}
function f(c) {
a[c] !== s && o.group.remove(a[c]);
}
}, e.prototype.unmount = function() {
if (!(process.env.NODE_ENV !== "production" && !this._mounted))
return this.enableBrush(!1), gg(this), this._zr.remove(this.group), process.env.NODE_ENV !== "production" && (this._mounted = !1), this;
}, e.prototype.dispose = function() {
this.unmount(), this.off();
}, e;
}(xr)
);
function R2(r, e) {
var t = gc[e.brushType].createCover(r, e);
return t.__brushOption = e, V2(t, e), r.group.add(t), t;
}
function N2(r, e) {
var t = bm(e);
return t.endCreating && (t.endCreating(r, e), V2(e, e.__brushOption)), e;
}
function O2(r, e) {
var t = e.__brushOption;
bm(e).updateCoverShape(r, e, t.range, t);
}
function V2(r, e) {
var t = e.z;
t == null && (t = fH), r.traverse(function(n) {
n.z = t, n.z2 = t;
});
}
function xm(r, e) {
bm(e).updateCommon(r, e), O2(r, e);
}
function bm(r) {
return gc[r.__brushOption.brushType];
}
function wm(r, e, t) {
var n = r._panels;
if (!n)
return Di;
var a, i = r._transform;
return A(n, function(o) {
o.isTargetByCursor(e, t, i) && (a = o);
}), a;
}
function B2(r, e) {
var t = r._panels;
if (!t)
return Di;
var n = e.__brushOption.panelId;
return n != null ? t[n] : Di;
}
function gg(r) {
var e = r._covers, t = e.length;
return A(e, function(n) {
r.group.remove(n);
}, r), e.length = 0, !!t;
}
function Ai(r, e) {
var t = G(r._covers, function(n) {
var a = n.__brushOption, i = nt(a.range);
return {
brushType: a.brushType,
panelId: a.panelId,
range: i
};
});
r.trigger("brush", {
areas: t,
isEnd: !!e.isEnd,
removeOnClick: !!e.removeOnClick
});
}
function yH(r) {
var e = r._track;
if (!e.length)
return !1;
var t = e[e.length - 1], n = e[0], a = t[0] - n[0], i = t[1] - n[1], o = hH(a * a + i * i, 0.5);
return o > cH;
}
function z2(r) {
var e = r.length - 1;
return e < 0 && (e = 0), [r[0], r[e]];
}
function G2(r, e, t, n) {
var a = new at();
return a.add(new xt({
name: "main",
style: Tm(t),
silent: !0,
draggable: !0,
cursor: "move",
drift: ut(Zx, r, e, a, ["n", "s", "w", "e"]),
ondragend: ut(Ai, e, {
isEnd: !0
})
})), A(n, function(i) {
a.add(new xt({
name: i.join(""),
style: {
opacity: 0
},
draggable: !0,
silent: !0,
invisible: !0,
drift: ut(Zx, r, e, a, i),
ondragend: ut(Ai, e, {
isEnd: !0
})
}));
}), a;
}
function F2(r, e, t, n) {
var a = n.brushStyle.lineWidth || 0, i = Po(a, vH), o = t[0][0], s = t[1][0], l = o - a / 2, u = s - a / 2, h = t[0][1], f = t[1][1], c = h - i + a / 2, v = f - i + a / 2, p = h - o, d = f - s, g = p + a, y = d + a;
vn(r, e, "main", o, s, p, d), n.transformable && (vn(r, e, "w", l, u, i, y), vn(r, e, "e", c, u, i, y), vn(r, e, "n", l, u, g, i), vn(r, e, "s", l, v, g, i), vn(r, e, "nw", l, u, i, i), vn(r, e, "ne", c, u, i, i), vn(r, e, "sw", l, v, i, i), vn(r, e, "se", c, v, i, i));
}
function yg(r, e) {
var t = e.__brushOption, n = t.transformable, a = e.childAt(0);
a.useStyle(Tm(t)), a.attr({
silent: !n,
cursor: n ? "move" : "default"
}), A([["w"], ["e"], ["n"], ["s"], ["s", "e"], ["s", "w"], ["n", "e"], ["n", "w"]], function(i) {
var o = e.childOfName(i.join("")), s = i.length === 1 ? mg(r, i[0]) : _H(r, i);
o && o.attr({
silent: !n,
invisible: !n,
cursor: n ? dH[s] + "-resize" : null
});
});
}
function vn(r, e, t, n, a, i, o) {
var s = e.childOfName(t);
s && s.setShape(xH(Cm(r, e, [[n, a], [n + i, a + o]])));
}
function Tm(r) {
return et({
strokeNoScale: !0
}, r.brushStyle);
}
function H2(r, e, t, n) {
var a = [Ml(r, t), Ml(e, n)], i = [Po(r, t), Po(e, n)];
return [
[a[0], i[0]],
[a[1], i[1]]
// y range
];
}
function mH(r) {
return pi(r.group);
}
function mg(r, e) {
var t = {
w: "left",
e: "right",
n: "top",
s: "bottom"
}, n = {
left: "w",
right: "e",
top: "n",
bottom: "s"
}, a = Xf(t[e], mH(r));
return n[a];
}
function _H(r, e) {
var t = [mg(r, e[0]), mg(r, e[1])];
return (t[0] === "e" || t[0] === "w") && t.reverse(), t.join("");
}
function Zx(r, e, t, n, a, i) {
var o = t.__brushOption, s = r.toRectRange(o.range), l = W2(e, a, i);
A(n, function(u) {
var h = pH[u];
s[h[0]][h[1]] += l[h[0]];
}), o.range = r.fromRectRange(H2(s[0][0], s[1][0], s[0][1], s[1][1])), xm(e, t), Ai(e, {
isEnd: !1
});
}
function SH(r, e, t, n) {
var a = e.__brushOption.range, i = W2(r, t, n);
A(a, function(o) {
o[0] += i[0], o[1] += i[1];
}), xm(r, e), Ai(r, {
isEnd: !1
});
}
function W2(r, e, t) {
var n = r.group, a = n.transformCoordToLocal(e, t), i = n.transformCoordToLocal(0, 0);
return [a[0] - i[0], a[1] - i[1]];
}
function Cm(r, e, t) {
var n = B2(r, e);
return n && n !== Di ? n.clipPath(t, r._transform) : nt(t);
}
function xH(r) {
var e = Ml(r[0][0], r[1][0]), t = Ml(r[0][1], r[1][1]), n = Po(r[0][0], r[1][0]), a = Po(r[0][1], r[1][1]);
return {
x: e,
y: t,
width: n - e,
height: a - t
};
}
function bH(r, e, t) {
if (
// Check active
!(!r._brushType || TH(r, e.offsetX, e.offsetY))
) {
var n = r._zr, a = r._covers, i = wm(r, e, t);
if (!r._dragging)
for (var o = 0; o < a.length; o++) {
var s = a[o].__brushOption;
if (i && (i === Di || s.panelId === i.panelId) && gc[s.brushType].contain(a[o], t[0], t[1]))
return;
}
i && n.setCursorStyle("crosshair");
}
}
function _g(r) {
var e = r.event;
e.preventDefault && e.preventDefault();
}
function Sg(r, e, t) {
return r.childOfName("main").contain(e, t);
}
function $2(r, e, t, n) {
var a = r._creatingCover, i = r._creatingPanel, o = r._brushOption, s;
if (r._track.push(t.slice()), yH(r) || a) {
if (i && !a) {
o.brushMode === "single" && gg(r);
var l = nt(o);
l.brushType = Xx(l.brushType, i), l.panelId = i === Di ? null : i.panelId, a = r._creatingCover = R2(r, l), r._covers.push(a);
}
if (a) {
var u = gc[Xx(r._brushType, i)], h = a.__brushOption;
h.range = u.getCreatingRange(Cm(r, a, r._track)), n && (N2(r, a), u.updateCommon(r, a)), O2(r, a), s = {
isEnd: n
};
}
} else n && o.brushMode === "single" && o.removeOnClick && wm(r, e, t) && gg(r) && (s = {
isEnd: n,
removeOnClick: !0
});
return s;
}
function Xx(r, e) {
return r === "auto" ? (process.env.NODE_ENV !== "production" && tt(e && e.defaultBrushType, 'MUST have defaultBrushType when brushType is "atuo"'), e.defaultBrushType) : r;
}
var wH = {
mousedown: function(r) {
if (this._dragging)
qx(this, r);
else if (!r.target || !r.target.draggable) {
_g(r);
var e = this.group.transformCoordToLocal(r.offsetX, r.offsetY);
this._creatingCover = null;
var t = this._creatingPanel = wm(this, r, e);
t && (this._dragging = !0, this._track = [e.slice()]);
}
},
mousemove: function(r) {
var e = r.offsetX, t = r.offsetY, n = this.group.transformCoordToLocal(e, t);
if (bH(this, r, n), this._dragging) {
_g(r);
var a = $2(this, r, n, !1);
a && Ai(this, a);
}
},
mouseup: function(r) {
qx(this, r);
}
};
function qx(r, e) {
if (r._dragging) {
_g(e);
var t = e.offsetX, n = e.offsetY, a = r.group.transformCoordToLocal(t, n), i = $2(r, e, a, !0);
r._dragging = !1, r._track = [], r._creatingCover = null, i && Ai(r, i);
}
}
function TH(r, e, t) {
var n = r._zr;
return e < 0 || e > n.getWidth() || t < 0 || t > n.getHeight();
}
var gc = {
lineX: Kx(0),
lineY: Kx(1),
rect: {
createCover: function(r, e) {
function t(n) {
return n;
}
return G2({
toRectRange: t,
fromRectRange: t
}, r, e, [["w"], ["e"], ["n"], ["s"], ["s", "e"], ["s", "w"], ["n", "e"], ["n", "w"]]);
},
getCreatingRange: function(r) {
var e = z2(r);
return H2(e[1][0], e[1][1], e[0][0], e[0][1]);
},
updateCoverShape: function(r, e, t, n) {
F2(r, e, t, n);
},
updateCommon: yg,
contain: Sg
},
polygon: {
createCover: function(r, e) {
var t = new at();
return t.add(new He({
name: "main",
style: Tm(e),
silent: !0
})), t;
},
getCreatingRange: function(r) {
return r;
},
endCreating: function(r, e) {
e.remove(e.childAt(0)), e.add(new Fe({
name: "main",
draggable: !0,
drift: ut(SH, r, e),
ondragend: ut(Ai, r, {
isEnd: !0
})
}));
},
updateCoverShape: function(r, e, t, n) {
e.childAt(0).setShape({
points: Cm(r, e, t)
});
},
updateCommon: yg,
contain: Sg
}
};
function Kx(r) {
return {
createCover: function(e, t) {
return G2({
toRectRange: function(n) {
var a = [n, [0, 100]];
return r && a.reverse(), a;
},
fromRectRange: function(n) {
return n[r];
}
}, e, t, [[["w"], ["e"]], [["n"], ["s"]]][r]);
},
getCreatingRange: function(e) {
var t = z2(e), n = Ml(t[0][r], t[1][r]), a = Po(t[0][r], t[1][r]);
return [n, a];
},
updateCoverShape: function(e, t, n, a) {
var i, o = B2(e, t);
if (o !== Di && o.getLinearBrushOtherExtent)
i = o.getLinearBrushOtherExtent(r);
else {
var s = e._zr;
i = [0, [s.getWidth(), s.getHeight()][1 - r]];
}
var l = [n, i];
r && l.reverse(), F2(e, t, l, a);
},
updateCommon: yg,
contain: Sg
};
}
function U2(r) {
return r = Dm(r), function(e) {
return nD(e, r);
};
}
function Y2(r, e) {
return r = Dm(r), function(t) {
var n = e ?? t, a = n ? r.width : r.height, i = n ? r.x : r.y;
return [i, i + (a || 0)];
};
}
function Z2(r, e, t) {
var n = Dm(r);
return function(a, i) {
return n.contain(i[0], i[1]) && !cc(a, e, t);
};
}
function Dm(r) {
return ct.create(r);
}
var CH = ["axisLine", "axisTickLabel", "axisName"], DH = (
/** @class */
function(r) {
O(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t.type = e.type, t;
}
return e.prototype.init = function(t, n) {
r.prototype.init.apply(this, arguments), (this._brushController = new Sm(n.getZr())).on("brush", Y(this._onBrush, this));
}, e.prototype.render = function(t, n, a, i) {
if (!AH(t, n, i)) {
this.axisModel = t, this.api = a, this.group.removeAll();
var o = this._axisGroup;
if (this._axisGroup = new at(), this.group.add(this._axisGroup), !!t.get("show")) {
var s = IH(t, n), l = s.coordinateSystem, u = t.getAreaSelectStyle(), h = u.width, f = t.axis.dim, c = l.getAxisLayout(f), v = B({
strokeContainThreshold: h
}, c), p = new Oe(t, v);
A(CH, p.add, p), this._axisGroup.add(p.getGroup()), this._refreshBrushController(v, u, t, s, h, a), Fl(o, this._axisGroup, t);
}
}
}, e.prototype._refreshBrushController = function(t, n, a, i, o, s) {
var l = a.axis.getExtent(), u = l[1] - l[0], h = Math.min(30, Math.abs(u) * 0.1), f = ct.create({
x: l[0],
y: -o / 2,
width: u,
height: o
});
f.x -= h, f.width += 2 * h, this._brushController.mount({
enableGlobalPan: !0,
rotation: t.rotation,
x: t.position[0],
y: t.position[1]
}).setPanels([{
panelId: "pl",
clipPath: U2(f),
isTargetByCursor: Z2(f, s, i),
getLinearBrushOtherExtent: Y2(f, 0)
}]).enableBrush({
brushType: "lineX",
brushStyle: n,
removeOnClick: !0
}).updateCovers(MH(a));
}, e.prototype._onBrush = function(t) {
var n = t.areas, a = this.axisModel, i = a.axis, o = G(n, function(s) {
return [i.coordToData(s.range[0], !0), i.coordToData(s.range[1], !0)];
});
(!a.option.realtime === t.isEnd || t.removeOnClick) && this.api.dispatchAction({
type: "axisAreaSelect",
parallelAxisId: a.id,
intervals: o
});
}, e.prototype.dispose = function() {
this._brushController.dispose();
}, e.type = "parallelAxis", e;
}(Yt)
);
function AH(r, e, t) {
return t && t.type === "axisAreaSelect" && e.findComponents({
mainType: "parallelAxis",
query: t
})[0] === r;
}
function MH(r) {
var e = r.axis;
return G(r.activeIntervals, function(t) {
return {
brushType: "lineX",
panelId: "pl",
range: [e.dataToCoord(t[0], !0), e.dataToCoord(t[1], !0)]
};
});
}
function IH(r, e) {
return e.getComponent("parallel", r.get("parallelIndex"));
}
var LH = {
type: "axisAreaSelect",
event: "axisAreaSelected"
// update: 'updateVisual'
};
function EH(r) {
r.registerAction(LH, function(e, t) {
t.eachComponent({
mainType: "parallelAxis",
query: e
}, function(n) {
n.axis.model.setActiveIntervals(e.intervals);
});
}), r.registerAction("parallelAxisExpand", function(e, t) {
t.eachComponent({
mainType: "parallel",
query: e
}, function(n) {
n.setAxisExpand(e);
});
});
}
var PH = {
type: "value",
areaSelectStyle: {
width: 20,
borderWidth: 1,
borderColor: "rgba(160,197,232)",
color: "rgba(160,197,232)",
opacity: 0.3
},
realtime: !0,
z: 10
};
function X2(r) {
r.registerComponentView(J4), r.registerComponentModel(eH), r.registerCoordinateSystem("parallel", uH), r.registerPreprocessor(q4), r.registerComponentModel(dg), r.registerComponentView(DH), Eo(r, "parallel", dg, PH), EH(r);
}
function kH(r) {
gt(X2), r.registerChartView(F4), r.registerSeriesModel($4), r.registerVisual(r.PRIORITY.VISUAL.BRUSH, X4);
}
var RH = (
/** @class */
/* @__PURE__ */ function() {
function r() {
this.x1 = 0, this.y1 = 0, this.x2 = 0, this.y2 = 0, this.cpx1 = 0, this.cpy1 = 0, this.cpx2 = 0, this.cpy2 = 0, this.extent = 0;
}
return r;
}()
), NH = (
/** @class */
function(r) {
O(e, r);
function e(t) {
return r.call(this, t) || this;
}
return e.prototype.getDefaultShape = function() {
return new RH();
}, e.prototype.buildPath = function(t, n) {
var a = n.extent;
t.moveTo(n.x1, n.y1), t.bezierCurveTo(n.cpx1, n.cpy1, n.cpx2, n.cpy2, n.x2, n.y2), n.orient === "vertical" ? (t.lineTo(n.x2 + a, n.y2), t.bezierCurveTo(n.cpx2 + a, n.cpy2, n.cpx1 + a, n.cpy1, n.x1 + a, n.y1)) : (t.lineTo(n.x2, n.y2 + a), t.bezierCurveTo(n.cpx2, n.cpy2 + a, n.cpx1, n.cpy1 + a, n.x1, n.y1 + a)), t.closePath();
}, e.prototype.highlight = function() {
Mn(this);
}, e.prototype.downplay = function() {
In(this);
}, e;
}(mt)
), OH = (
/** @class */
function(r) {
O(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t.type = e.type, t._focusAdjacencyDisabled = !1, t;
}
return e.prototype.render = function(t, n, a) {
var i = this, o = t.getGraph(), s = this.group, l = t.layoutInfo, u = l.width, h = l.height, f = t.getData(), c = t.getData("edge"), v = t.get("orient");
this._model = t, s.removeAll(), s.x = l.x, s.y = l.y, o.eachEdge(function(p) {
var d = new NH(), g = it(d);
g.dataIndex = p.dataIndex, g.seriesIndex = t.seriesIndex, g.dataType = "edge";
var y = p.getModel(), m = y.getModel("lineStyle"), _ = m.get("curveness"), S = p.node1.getLayout(), x = p.node1.getModel(), b = x.get("localX"), w = x.get("localY"), T = p.node2.getLayout(), C = p.node2.getModel(), D = C.get("localX"), M = C.get("localY"), I = p.getLayout(), L, E, P, k, N, R, V, F;
d.shape.extent = Math.max(1, I.dy), d.shape.orient = v, v === "vertical" ? (L = (b != null ? b * u : S.x) + I.sy, E = (w != null ? w * h : S.y) + S.dy, P = (D != null ? D * u : T.x) + I.ty, k = M != null ? M * h : T.y, N = L, R = E * (1 - _) + k * _, V = P, F = E * _ + k * (1 - _)) : (L = (b != null ? b * u : S.x) + S.dx, E = (w != null ? w * h : S.y) + I.sy, P = D != null ? D * u : T.x, k = (M != null ? M * h : T.y) + I.ty, N = L * (1 - _) + P * _, R = E, V = L * _ + P * (1 - _), F = k), d.setShape({
x1: L,
y1: E,
x2: P,
y2: k,
cpx1: N,
cpy1: R,
cpx2: V,
cpy2: F
}), d.useStyle(m.getItemStyle()), jx(d.style, v, p);
var H = "" + y.get("value"), $ = ve(y, "edgeLabel");
xe(d, $, {
labelFetcher: {
getFormattedLabel: function(st, Et, qt, vt, rt, dt) {
return t.getFormattedLabel(
st,
Et,
"edge",
vt,
// ensure edgeLabel formatter is provided
// to prevent the inheritance from `label.formatter` of the series
mr(rt, $.normal && $.normal.get("formatter"), H),
dt
);
}
},
labelDataIndex: p.dataIndex,
defaultText: H
}), d.setTextConfig({
position: "inside"
});
var j = y.getModel("emphasis");
Se(d, y, "lineStyle", function(st) {
var Et = st.getItemStyle();
return jx(Et, v, p), Et;
}), s.add(d), c.setItemGraphicEl(p.dataIndex, d);
var Q = j.get("focus");
Xt(d, Q === "adjacency" ? p.getAdjacentDataIndices() : Q === "trajectory" ? p.getTrajectoryDataIndices() : Q, j.get("blurScope"), j.get("disabled"));
}), o.eachNode(function(p) {
var d = p.getLayout(), g = p.getModel(), y = g.get("localX"), m = g.get("localY"), _ = g.getModel("emphasis"), S = g.get(["itemStyle", "borderRadius"]) || 0, x = new xt({
shape: {
x: y != null ? y * u : d.x,
y: m != null ? m * h : d.y,
width: d.dx,
height: d.dy,
r: S
},
style: g.getModel("itemStyle").getItemStyle(),
z2: 10
});
xe(x, ve(g), {
labelFetcher: {
getFormattedLabel: function(w, T) {
return t.getFormattedLabel(w, T, "node");
}
},
labelDataIndex: p.dataIndex,
defaultText: p.id
}), x.disableLabelAnimation = !0, x.setStyle("fill", p.getVisual("color")), x.setStyle("decal", p.getVisual("style").decal), Se(x, g), s.add(x), f.setItemGraphicEl(p.dataIndex, x), it(x).dataType = "node";
var b = _.get("focus");
Xt(x, b === "adjacency" ? p.getAdjacentDataIndices() : b === "trajectory" ? p.getTrajectoryDataIndices() : b, _.get("blurScope"), _.get("disabled"));
}), f.eachItemGraphicEl(function(p, d) {
var g = f.getItemModel(d);
g.get("draggable") && (p.drift = function(y, m) {
i._focusAdjacencyDisabled = !0, this.shape.x += y, this.shape.y += m, this.dirty(), a.dispatchAction({
type: "dragNode",
seriesId: t.id,
dataIndex: f.getRawIndex(d),
localX: this.shape.x / u,
localY: this.shape.y / h
});
}, p.ondragend = function() {
i._focusAdjacencyDisabled = !1;
}, p.draggable = !0, p.cursor = "move");
}), !this._data && t.isAnimationEnabled() && s.setClipPath(VH(s.getBoundingRect(), t, function() {
s.removeClipPath();
})), this._data = t.getData();
}, e.prototype.dispose = function() {
}, e.type = "sankey", e;
}(kt)
);
function jx(r, e, t) {
switch (r.fill) {
case "source":
r.fill = t.node1.getVisual("color"), r.decal = t.node1.getVisual("style").decal;
break;
case "target":
r.fill = t.node2.getVisual("color"), r.decal = t.node2.getVisual("style").decal;
break;
case "gradient":
var n = t.node1.getVisual("color"), a = t.node2.getVisual("color");
U(n) && U(a) && (r.fill = new Gl(0, 0, +(e === "horizontal"), +(e === "vertical"), [{
color: n,
offset: 0
}, {
color: a,
offset: 1
}]));
}
}
function VH(r, e, t) {
var n = new xt({
shape: {
x: r.x - 10,
y: r.y - 10,
width: 0,
height: r.height + 20
}
});
return $t(n, {
shape: {
width: r.width + 20
}
}, e, t), n;
}
var BH = (
/** @class */
function(r) {
O(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t.type = e.type, t;
}
return e.prototype.getInitialData = function(t, n) {
var a = t.edges || t.links || [], i = t.data || t.nodes || [], o = t.levels || [];
this.levelModels = [];
for (var s = this.levelModels, l = 0; l < o.length; l++)
if (o[l].depth != null && o[l].depth >= 0)
s[o[l].depth] = new It(o[l], this, n);
else if (process.env.NODE_ENV !== "production")
throw new Error("levels[i].depth is mandatory and should be natural number");
var u = L2(i, a, this, !0, h);
return u.data;
function h(f, c) {
f.wrapMethod("getItemModel", function(v, p) {
var d = v.parentModel, g = d.getData().getItemLayout(p);
if (g) {
var y = g.depth, m = d.levelModels[y];
m && (v.parentModel = m);
}
return v;
}), c.wrapMethod("getItemModel", function(v, p) {
var d = v.parentModel, g = d.getGraph().getEdgeByIndex(p), y = g.node1.getLayout();
if (y) {
var m = y.depth, _ = d.levelModels[m];
_ && (v.parentModel = _);
}
return v;
});
}
}, e.prototype.setNodePosition = function(t, n) {
var a = this.option.data || this.option.nodes, i = a[t];
i.localX = n[0], i.localY = n[1];
}, e.prototype.getGraph = function() {
return this.getData().graph;
}, e.prototype.getEdgeData = function() {
return this.getGraph().edgeData;
}, e.prototype.formatTooltip = function(t, n, a) {
function i(v) {
return isNaN(v) || v == null;
}
if (a === "edge") {
var o = this.getDataParams(t, a), s = o.data, l = o.value, u = s.source + " -- " + s.target;
return pe("nameValue", {
name: u,
value: l,
noValue: i(l)
});
} else {
var h = this.getGraph().getNodeByIndex(t), f = h.getLayout().value, c = this.getDataParams(t, a).data.name;
return pe("nameValue", {
name: c != null ? c + "" : null,
value: f,
noValue: i(f)
});
}
}, e.prototype.optionUpdated = function() {
}, e.prototype.getDataParams = function(t, n) {
var a = r.prototype.getDataParams.call(this, t, n);
if (a.value == null && n === "node") {
var i = this.getGraph().getNodeByIndex(t), o = i.getLayout().value;
a.value = o;
}
return a;
}, e.type = "series.sankey", e.defaultOption = {
// zlevel: 0,
z: 2,
coordinateSystem: "view",
left: "5%",
top: "5%",
right: "20%",
bottom: "5%",
orient: "horizontal",
nodeWidth: 20,
nodeGap: 8,
draggable: !0,
layoutIterations: 32,
label: {
show: !0,
position: "right",
fontSize: 12
},
edgeLabel: {
show: !1,
fontSize: 12
},
levels: [],
nodeAlign: "justify",
lineStyle: {
color: "#314656",
opacity: 0.2,
curveness: 0.5
},
emphasis: {
label: {
show: !0
},
lineStyle: {
opacity: 0.5
}
},
select: {
itemStyle: {
borderColor: "#212121"
}
},
animationEasing: "linear",
animationDuration: 1e3
}, e;
}(Ft)
);
function zH(r, e) {
r.eachSeriesByType("sankey", function(t) {
var n = t.get("nodeWidth"), a = t.get("nodeGap"), i = GH(t, e);
t.layoutInfo = i;
var o = i.width, s = i.height, l = t.getGraph(), u = l.nodes, h = l.edges;
HH(u);
var f = At(u, function(d) {
return d.getLayout().value === 0;
}), c = f.length !== 0 ? 0 : t.get("layoutIterations"), v = t.get("orient"), p = t.get("nodeAlign");
FH(u, h, n, a, o, s, c, v, p);
});
}
function GH(r, e) {
return se(r.getBoxLayoutParams(), {
width: e.getWidth(),
height: e.getHeight()
});
}
function FH(r, e, t, n, a, i, o, s, l) {
WH(r, e, t, a, i, s, l), ZH(r, e, i, a, n, o, s), rW(r, s);
}
function HH(r) {
A(r, function(e) {
var t = la(e.outEdges, cf), n = la(e.inEdges, cf), a = e.getValue() || 0, i = Math.max(t, n, a);
e.setLayout({
value: i
}, !0);
});
}
function WH(r, e, t, n, a, i, o) {
for (var s = [], l = [], u = [], h = [], f = 0, c = 0; c < e.length; c++)
s[c] = 1;
for (var c = 0; c < r.length; c++)
l[c] = r[c].inEdges.length, l[c] === 0 && u.push(r[c]);
for (var v = -1; u.length; ) {
for (var p = 0; p < u.length; p++) {
var d = u[p], g = d.hostGraph.data.getRawDataItem(d.dataIndex), y = g.depth != null && g.depth >= 0;
y && g.depth > v && (v = g.depth), d.setLayout({
depth: y ? g.depth : f
}, !0), i === "vertical" ? d.setLayout({
dy: t
}, !0) : d.setLayout({
dx: t
}, !0);
for (var m = 0; m < d.outEdges.length; m++) {
var _ = d.outEdges[m], S = e.indexOf(_);
s[S] = 0;
var x = _.node2, b = r.indexOf(x);
--l[b] === 0 && h.indexOf(x) < 0 && h.push(x);
}
}
++f, u = h, h = [];
}
for (var c = 0; c < s.length; c++)
if (s[c] === 1)
throw new Error("Sankey is a DAG, the original data has cycle!");
var w = v > f - 1 ? v : f - 1;
o && o !== "left" && $H(r, o, i, w);
var T = i === "vertical" ? (a - t) / w : (n - t) / w;
YH(r, T, i);
}
function q2(r) {
var e = r.hostGraph.data.getRawDataItem(r.dataIndex);
return e.depth != null && e.depth >= 0;
}
function $H(r, e, t, n) {
if (e === "right") {
for (var a = [], i = r, o = 0; i.length; ) {
for (var s = 0; s < i.length; s++) {
var l = i[s];
l.setLayout({
skNodeHeight: o
}, !0);
for (var u = 0; u < l.inEdges.length; u++) {
var h = l.inEdges[u];
a.indexOf(h.node1) < 0 && a.push(h.node1);
}
}
i = a, a = [], ++o;
}
A(r, function(f) {
q2(f) || f.setLayout({
depth: Math.max(0, n - f.getLayout().skNodeHeight)
}, !0);
});
} else e === "justify" && UH(r, n);
}
function UH(r, e) {
A(r, function(t) {
!q2(t) && !t.outEdges.length && t.setLayout({
depth: e
}, !0);
});
}
function YH(r, e, t) {
A(r, function(n) {
var a = n.getLayout().depth * e;
t === "vertical" ? n.setLayout({
y: a
}, !0) : n.setLayout({
x: a
}, !0);
});
}
function ZH(r, e, t, n, a, i, o) {
var s = XH(r, o);
qH(s, e, t, n, a, o), pp(s, a, t, n, o);
for (var l = 1; i > 0; i--)
l *= 0.99, KH(s, l, o), pp(s, a, t, n, o), eW(s, l, o), pp(s, a, t, n, o);
}
function XH(r, e) {
var t = [], n = e === "vertical" ? "y" : "x", a = Sd(r, function(i) {
return i.getLayout()[n];
});
return a.keys.sort(function(i, o) {
return i - o;
}), A(a.keys, function(i) {
t.push(a.buckets.get(i));
}), t;
}
function qH(r, e, t, n, a, i) {
var o = 1 / 0;
A(r, function(s) {
var l = s.length, u = 0;
A(s, function(f) {
u += f.getLayout().value;
});
var h = i === "vertical" ? (n - (l - 1) * a) / u : (t - (l - 1) * a) / u;
h < o && (o = h);
}), A(r, function(s) {
A(s, function(l, u) {
var h = l.getLayout().value * o;
i === "vertical" ? (l.setLayout({
x: u
}, !0), l.setLayout({
dx: h
}, !0)) : (l.setLayout({
y: u
}, !0), l.setLayout({
dy: h
}, !0));
});
}), A(e, function(s) {
var l = +s.getValue() * o;
s.setLayout({
dy: l
}, !0);
});
}
function pp(r, e, t, n, a) {
var i = a === "vertical" ? "x" : "y";
A(r, function(o) {
o.sort(function(d, g) {
return d.getLayout()[i] - g.getLayout()[i];
});
for (var s, l, u, h = 0, f = o.length, c = a === "vertical" ? "dx" : "dy", v = 0; v < f; v++)
l = o[v], u = h - l.getLayout()[i], u > 0 && (s = l.getLayout()[i] + u, a === "vertical" ? l.setLayout({
x: s
}, !0) : l.setLayout({
y: s
}, !0)), h = l.getLayout()[i] + l.getLayout()[c] + e;
var p = a === "vertical" ? n : t;
if (u = h - e - p, u > 0) {
s = l.getLayout()[i] - u, a === "vertical" ? l.setLayout({
x: s
}, !0) : l.setLayout({
y: s
}, !0), h = s;
for (var v = f - 2; v >= 0; --v)
l = o[v], u = l.getLayout()[i] + l.getLayout()[c] + e - h, u > 0 && (s = l.getLayout()[i] - u, a === "vertical" ? l.setLayout({
x: s
}, !0) : l.setLayout({
y: s
}, !0)), h = l.getLayout()[i];
}
});
}
function KH(r, e, t) {
A(r.slice().reverse(), function(n) {
A(n, function(a) {
if (a.outEdges.length) {
var i = la(a.outEdges, jH, t) / la(a.outEdges, cf);
if (isNaN(i)) {
var o = a.outEdges.length;
i = o ? la(a.outEdges, QH, t) / o : 0;
}
if (t === "vertical") {
var s = a.getLayout().x + (i - ga(a, t)) * e;
a.setLayout({
x: s
}, !0);
} else {
var l = a.getLayout().y + (i - ga(a, t)) * e;
a.setLayout({
y: l
}, !0);
}
}
});
});
}
function jH(r, e) {
return ga(r.node2, e) * r.getValue();
}
function QH(r, e) {
return ga(r.node2, e);
}
function JH(r, e) {
return ga(r.node1, e) * r.getValue();
}
function tW(r, e) {
return ga(r.node1, e);
}
function ga(r, e) {
return e === "vertical" ? r.getLayout().x + r.getLayout().dx / 2 : r.getLayout().y + r.getLayout().dy / 2;
}
function cf(r) {
return r.getValue();
}
function la(r, e, t) {
for (var n = 0, a = r.length, i = -1; ++i < a; ) {
var o = +e(r[i], t);
isNaN(o) || (n += o);
}
return n;
}
function eW(r, e, t) {
A(r, function(n) {
A(n, function(a) {
if (a.inEdges.length) {
var i = la(a.inEdges, JH, t) / la(a.inEdges, cf);
if (isNaN(i)) {
var o = a.inEdges.length;
i = o ? la(a.inEdges, tW, t) / o : 0;
}
if (t === "vertical") {
var s = a.getLayout().x + (i - ga(a, t)) * e;
a.setLayout({
x: s
}, !0);
} else {
var l = a.getLayout().y + (i - ga(a, t)) * e;
a.setLayout({
y: l
}, !0);
}
}
});
});
}
function rW(r, e) {
var t = e === "vertical" ? "x" : "y";
A(r, function(n) {
n.outEdges.sort(function(a, i) {
return a.node2.getLayout()[t] - i.node2.getLayout()[t];
}), n.inEdges.sort(function(a, i) {
return a.node1.getLayout()[t] - i.node1.getLayout()[t];
});
}), A(r, function(n) {
var a = 0, i = 0;
A(n.outEdges, function(o) {
o.setLayout({
sy: a
}, !0), a += o.getLayout().dy;
}), A(n.inEdges, function(o) {
o.setLayout({
ty: i
}, !0), i += o.getLayout().dy;
});
});
}
function nW(r) {
r.eachSeriesByType("sankey", function(e) {
var t = e.getGraph(), n = t.nodes, a = t.edges;
if (n.length) {
var i = 1 / 0, o = -1 / 0;
A(n, function(s) {
var l = s.getLayout().value;
l < i && (i = l), l > o && (o = l);
}), A(n, function(s) {
var l = new ce({
type: "color",
mappingMethod: "linear",
dataExtent: [i, o],
visual: e.get("color")
}), u = l.mapValueToVisual(s.getLayout().value), h = s.getModel().get(["itemStyle", "color"]);
h != null ? (s.setVisual("color", h), s.setVisual("style", {
fill: h
})) : (s.setVisual("color", u), s.setVisual("style", {
fill: u
}));
});
}
a.length && A(a, function(s) {
var l = s.getModel().get("lineStyle");
s.setVisual("style", l);
});
});
}
function aW(r) {
r.registerChartView(OH), r.registerSeriesModel(BH), r.registerLayout(zH), r.registerVisual(nW), r.registerAction({
type: "dragNode",
event: "dragnode",
// here can only use 'update' now, other value is not support in echarts.
update: "update"
}, function(e, t) {
t.eachComponent({
mainType: "series",
subType: "sankey",
query: e
}, function(n) {
n.setNodePosition(e.dataIndex, [e.localX, e.localY]);
});
});
}
var K2 = (
/** @class */
function() {
function r() {
}
return r.prototype._hasEncodeRule = function(e) {
var t = this.getEncode();
return t && t.get(e) != null;
}, r.prototype.getInitialData = function(e, t) {
var n, a = t.getComponent("xAxis", this.get("xAxisIndex")), i = t.getComponent("yAxis", this.get("yAxisIndex")), o = a.get("type"), s = i.get("type"), l;
o === "category" ? (e.layout = "horizontal", n = a.getOrdinalMeta(), l = !this._hasEncodeRule("x")) : s === "category" ? (e.layout = "vertical", n = i.getOrdinalMeta(), l = !this._hasEncodeRule("y")) : e.layout = e.layout || "horizontal";
var u = ["x", "y"], h = e.layout === "horizontal" ? 0 : 1, f = this._baseAxisDim = u[h], c = u[1 - h], v = [a, i], p = v[h].get("type"), d = v[1 - h].get("type"), g = e.data;
if (g && l) {
var y = [];
A(g, function(S, x) {
var b;
z(S) ? (b = S.slice(), S.unshift(x)) : z(S.value) ? (b = B({}, S), b.value = b.value.slice(), S.value.unshift(x)) : b = S, y.push(b);
}), e.data = y;
}
var m = this.defaultValueDimensions, _ = [{
name: f,
type: tf(p),
ordinalMeta: n,
otherDims: {
tooltip: !1,
itemName: 0
},
dimsDef: ["base"]
}, {
name: c,
type: tf(d),
dimsDef: m.slice()
}];
return jo(this, {
coordDimensions: _,
dimensionsCount: m.length + 1,
encodeDefaulter: ut(MD, _, this)
});
}, r.prototype.getBaseAxis = function() {
var e = this._baseAxisDim;
return this.ecModel.getComponent(e + "Axis", this.get(e + "AxisIndex")).axis;
}, r;
}()
), j2 = (
/** @class */
function(r) {
O(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t.type = e.type, t.defaultValueDimensions = [{
name: "min",
defaultTooltip: !0
}, {
name: "Q1",
defaultTooltip: !0
}, {
name: "median",
defaultTooltip: !0
}, {
name: "Q3",
defaultTooltip: !0
}, {
name: "max",
defaultTooltip: !0
}], t.visualDrawType = "stroke", t;
}
return e.type = "series.boxplot", e.dependencies = ["xAxis", "yAxis", "grid"], e.defaultOption = {
// zlevel: 0,
z: 2,
coordinateSystem: "cartesian2d",
legendHoverLink: !0,
layout: null,
boxWidth: [7, 50],
itemStyle: {
color: "#fff",
borderWidth: 1
},
emphasis: {
scale: !0,
itemStyle: {
borderWidth: 2,
shadowBlur: 5,
shadowOffsetX: 1,
shadowOffsetY: 1,
shadowColor: "rgba(0,0,0,0.2)"
}
},
animationDuration: 800
}, e;
}(Ft)
);
ie(j2, K2, !0);
var iW = (
/** @class */
function(r) {
O(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t.type = e.type, t;
}
return e.prototype.render = function(t, n, a) {
var i = t.getData(), o = this.group, s = this._data;
this._data || o.removeAll();
var l = t.get("layout") === "horizontal" ? 1 : 0;
i.diff(s).add(function(u) {
if (i.hasValue(u)) {
var h = i.getItemLayout(u), f = Qx(h, i, u, l, !0);
i.setItemGraphicEl(u, f), o.add(f);
}
}).update(function(u, h) {
var f = s.getItemGraphicEl(h);
if (!i.hasValue(u)) {
o.remove(f);
return;
}
var c = i.getItemLayout(u);
f ? (Or(f), Q2(c, f, i, u)) : f = Qx(c, i, u, l), o.add(f), i.setItemGraphicEl(u, f);
}).remove(function(u) {
var h = s.getItemGraphicEl(u);
h && o.remove(h);
}).execute(), this._data = i;
}, e.prototype.remove = function(t) {
var n = this.group, a = this._data;
this._data = null, a && a.eachItemGraphicEl(function(i) {
i && n.remove(i);
});
}, e.type = "boxplot", e;
}(kt)
), oW = (
/** @class */
/* @__PURE__ */ function() {
function r() {
}
return r;
}()
), sW = (
/** @class */
function(r) {
O(e, r);
function e(t) {
var n = r.call(this, t) || this;
return n.type = "boxplotBoxPath", n;
}
return e.prototype.getDefaultShape = function() {
return new oW();
}, e.prototype.buildPath = function(t, n) {
var a = n.points, i = 0;
for (t.moveTo(a[i][0], a[i][1]), i++; i < 4; i++)
t.lineTo(a[i][0], a[i][1]);
for (t.closePath(); i < a.length; i++)
t.moveTo(a[i][0], a[i][1]), i++, t.lineTo(a[i][0], a[i][1]);
}, e;
}(mt)
);
function Qx(r, e, t, n, a) {
var i = r.ends, o = new sW({
shape: {
points: a ? lW(i, n, r) : i
}
});
return Q2(r, o, e, t, a), o;
}
function Q2(r, e, t, n, a) {
var i = t.hostModel, o = Pi[a ? "initProps" : "updateProps"];
o(e, {
shape: {
points: r.ends
}
}, i, n), e.useStyle(t.getItemVisual(n, "style")), e.style.strokeNoScale = !0, e.z2 = 100;
var s = t.getItemModel(n), l = s.getModel("emphasis");
Se(e, s), Xt(e, l.get("focus"), l.get("blurScope"), l.get("disabled"));
}
function lW(r, e, t) {
return G(r, function(n) {
return n = n.slice(), n[e] = t.initBaseline, n;
});
}
var al = A;
function uW(r) {
var e = hW(r);
al(e, function(t) {
var n = t.seriesModels;
n.length && (fW(t), al(n, function(a, i) {
cW(a, t.boxOffsetList[i], t.boxWidthList[i]);
}));
});
}
function hW(r) {
var e = [], t = [];
return r.eachSeriesByType("boxplot", function(n) {
var a = n.getBaseAxis(), i = pt(t, a);
i < 0 && (i = t.length, t[i] = a, e[i] = {
axis: a,
seriesModels: []
}), e[i].seriesModels.push(n);
}), e;
}
function fW(r) {
var e = r.axis, t = r.seriesModels, n = t.length, a = r.boxWidthList = [], i = r.boxOffsetList = [], o = [], s;
if (e.type === "category")
s = e.getBandWidth();
else {
var l = 0;
al(t, function(p) {
l = Math.max(l, p.getData().count());
});
var u = e.getExtent();
s = Math.abs(u[1] - u[0]) / l;
}
al(t, function(p) {
var d = p.get("boxWidth");
z(d) || (d = [d, d]), o.push([W(d[0], s) || 0, W(d[1], s) || 0]);
});
var h = s * 0.8 - 2, f = h / n * 0.3, c = (h - f * (n - 1)) / n, v = c / 2 - h / 2;
al(t, function(p, d) {
i.push(v), v += f + c, a.push(Math.min(Math.max(c, o[d][0]), o[d][1]));
});
}
function cW(r, e, t) {
var n = r.coordinateSystem, a = r.getData(), i = t / 2, o = r.get("layout") === "horizontal" ? 0 : 1, s = 1 - o, l = ["x", "y"], u = a.mapDimension(l[o]), h = a.mapDimensionsAll(l[s]);
if (u == null || h.length < 5)
return;
for (var f = 0; f < a.count(); f++) {
var c = a.get(u, f), v = _(c, h[2], f), p = _(c, h[0], f), d = _(c, h[1], f), g = _(c, h[3], f), y = _(c, h[4], f), m = [];
S(m, d, !1), S(m, g, !0), m.push(p, d, y, g), x(m, p), x(m, y), x(m, v), a.setItemLayout(f, {
initBaseline: v[s],
ends: m
});
}
function _(b, w, T) {
var C = a.get(w, T), D = [];
D[o] = b, D[s] = C;
var M;
return isNaN(b) || isNaN(C) ? M = [NaN, NaN] : (M = n.dataToPoint(D), M[o] += e), M;
}
function S(b, w, T) {
var C = w.slice(), D = w.slice();
C[o] += i, D[o] -= i, T ? b.push(C, D) : b.push(D, C);
}
function x(b, w) {
var T = w.slice(), C = w.slice();
T[o] -= i, C[o] += i, b.push(T, C);
}
}
function vW(r, e) {
e = e || {};
for (var t = [], n = [], a = e.boundIQR, i = a === "none" || a === 0, o = 0; o < r.length; o++) {
var s = yr(r[o].slice()), l = Fc(s, 0.25), u = Fc(s, 0.5), h = Fc(s, 0.75), f = s[0], c = s[s.length - 1], v = (a ?? 1.5) * (h - l), p = i ? f : Math.max(f, l - v), d = i ? c : Math.min(c, h + v), g = e.itemNameFormatter, y = K(g) ? g({
value: o
}) : U(g) ? g.replace("{value}", o + "") : o + "";
t.push([y, p, l, u, h, d]);
for (var m = 0; m < s.length; m++) {
var _ = s[m];
if (_ < p || _ > d) {
var S = [y, _];
n.push(S);
}
}
}
return {
boxData: t,
outliers: n
};
}
var pW = {
type: "echarts:boxplot",
transform: function(e) {
var t = e.upstream;
if (t.sourceFormat !== Ae) {
var n = "";
process.env.NODE_ENV !== "production" && (n = Be("source data is not applicable for this boxplot transform. Expect number[][].")), Dt(n);
}
var a = vW(t.getRawData(), e.config);
return [{
dimensions: ["ItemName", "Low", "Q1", "Q2", "Q3", "High"],
data: a.boxData
}, {
data: a.outliers
}];
}
};
function dW(r) {
r.registerSeriesModel(j2), r.registerChartView(iW), r.registerLayout(uW), r.registerTransform(pW);
}
var gW = ["itemStyle", "borderColor"], yW = ["itemStyle", "borderColor0"], mW = ["itemStyle", "borderColorDoji"], _W = ["itemStyle", "color"], SW = ["itemStyle", "color0"];
function Am(r, e) {
return e.get(r > 0 ? _W : SW);
}
function Mm(r, e) {
return e.get(r === 0 ? mW : r > 0 ? gW : yW);
}
var xW = {
seriesType: "candlestick",
plan: Zo(),
// For legend.
performRawSeries: !0,
reset: function(r, e) {
if (!e.isSeriesFiltered(r)) {
var t = r.pipelineContext.large;
return !t && {
progress: function(n, a) {
for (var i; (i = n.next()) != null; ) {
var o = a.getItemModel(i), s = a.getItemLayout(i).sign, l = o.getItemStyle();
l.fill = Am(s, o), l.stroke = Mm(s, o) || l.fill;
var u = a.ensureUniqueItemVisual(i, "style");
B(u, l);
}
}
};
}
}
}, bW = ["color", "borderColor"], wW = (
/** @class */
function(r) {
O(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t.type = e.type, t;
}
return e.prototype.render = function(t, n, a) {
this.group.removeClipPath(), this._progressiveEls = null, this._updateDrawMode(t), this._isLargeDraw ? this._renderLarge(t) : this._renderNormal(t);
}, e.prototype.incrementalPrepareRender = function(t, n, a) {
this._clear(), this._updateDrawMode(t);
}, e.prototype.incrementalRender = function(t, n, a, i) {
this._progressiveEls = [], this._isLargeDraw ? this._incrementalRenderLarge(t, n) : this._incrementalRenderNormal(t, n);
}, e.prototype.eachRendered = function(t) {
ma(this._progressiveEls || this.group, t);
}, e.prototype._updateDrawMode = function(t) {
var n = t.pipelineContext.large;
(this._isLargeDraw == null || n !== this._isLargeDraw) && (this._isLargeDraw = n, this._clear());
}, e.prototype._renderNormal = function(t) {
var n = t.getData(), a = this._data, i = this.group, o = n.getLayout("isSimpleBox"), s = t.get("clip", !0), l = t.coordinateSystem, u = l.getArea && l.getArea();
this._data || i.removeAll(), n.diff(a).add(function(h) {
if (n.hasValue(h)) {
var f = n.getItemLayout(h);
if (s && Jx(u, f))
return;
var c = dp(f, h, !0);
$t(c, {
shape: {
points: f.ends
}
}, t, h), gp(c, n, h, o), i.add(c), n.setItemGraphicEl(h, c);
}
}).update(function(h, f) {
var c = a.getItemGraphicEl(f);
if (!n.hasValue(h)) {
i.remove(c);
return;
}
var v = n.getItemLayout(h);
if (s && Jx(u, v)) {
i.remove(c);
return;
}
c ? (Ct(c, {
shape: {
points: v.ends
}
}, t, h), Or(c)) : c = dp(v), gp(c, n, h, o), i.add(c), n.setItemGraphicEl(h, c);
}).remove(function(h) {
var f = a.getItemGraphicEl(h);
f && i.remove(f);
}).execute(), this._data = n;
}, e.prototype._renderLarge = function(t) {
this._clear(), tb(t, this.group);
var n = t.get("clip", !0) ? Xl(t.coordinateSystem, !1, t) : null;
n ? this.group.setClipPath(n) : this.group.removeClipPath();
}, e.prototype._incrementalRenderNormal = function(t, n) {
for (var a = n.getData(), i = a.getLayout("isSimpleBox"), o; (o = t.next()) != null; ) {
var s = a.getItemLayout(o), l = dp(s);
gp(l, a, o, i), l.incremental = !0, this.group.add(l), this._progressiveEls.push(l);
}
}, e.prototype._incrementalRenderLarge = function(t, n) {
tb(n, this.group, this._progressiveEls, !0);
}, e.prototype.remove = function(t) {
this._clear();
}, e.prototype._clear = function() {
this.group.removeAll(), this._data = null;
}, e.type = "candlestick", e;
}(kt)
), TW = (
/** @class */
/* @__PURE__ */ function() {
function r() {
}
return r;
}()
), CW = (
/** @class */
function(r) {
O(e, r);
function e(t) {
var n = r.call(this, t) || this;
return n.type = "normalCandlestickBox", n;
}
return e.prototype.getDefaultShape = function() {
return new TW();
}, e.prototype.buildPath = function(t, n) {
var a = n.points;
this.__simpleBox ? (t.moveTo(a[4][0], a[4][1]), t.lineTo(a[6][0], a[6][1])) : (t.moveTo(a[0][0], a[0][1]), t.lineTo(a[1][0], a[1][1]), t.lineTo(a[2][0], a[2][1]), t.lineTo(a[3][0], a[3][1]), t.closePath(), t.moveTo(a[4][0], a[4][1]), t.lineTo(a[5][0], a[5][1]), t.moveTo(a[6][0], a[6][1]), t.lineTo(a[7][0], a[7][1]));
}, e;
}(mt)
);
function dp(r, e, t) {
var n = r.ends;
return new CW({
shape: {
points: t ? DW(n, r) : n
},
z2: 100
});
}
function Jx(r, e) {
for (var t = !0, n = 0; n < e.ends.length; n++)
if (r.contain(e.ends[n][0], e.ends[n][1])) {
t = !1;
break;
}
return t;
}
function gp(r, e, t, n) {
var a = e.getItemModel(t);
r.useStyle(e.getItemVisual(t, "style")), r.style.strokeNoScale = !0, r.__simpleBox = n, Se(r, a);
var i = e.getItemLayout(t).sign;
A(r.states, function(s, l) {
var u = a.getModel(l), h = Am(i, u), f = Mm(i, u) || h, c = s.style || (s.style = {});
h && (c.fill = h), f && (c.stroke = f);
});
var o = a.getModel("emphasis");
Xt(r, o.get("focus"), o.get("blurScope"), o.get("disabled"));
}
function DW(r, e) {
return G(r, function(t) {
return t = t.slice(), t[1] = e.initBaseline, t;
});
}
var AW = (
/** @class */
/* @__PURE__ */ function() {
function r() {
}
return r;
}()
), yp = (
/** @class */
function(r) {
O(e, r);
function e(t) {
var n = r.call(this, t) || this;
return n.type = "largeCandlestickBox", n;
}
return e.prototype.getDefaultShape = function() {
return new AW();
}, e.prototype.buildPath = function(t, n) {
for (var a = n.points, i = 0; i < a.length; )
if (this.__sign === a[i++]) {
var o = a[i++];
t.moveTo(o, a[i++]), t.lineTo(o, a[i++]);
} else
i += 3;
}, e;
}(mt)
);
function tb(r, e, t, n) {
var a = r.getData(), i = a.getLayout("largePoints"), o = new yp({
shape: {
points: i
},
__sign: 1,
ignoreCoarsePointer: !0
});
e.add(o);
var s = new yp({
shape: {
points: i
},
__sign: -1,
ignoreCoarsePointer: !0
});
e.add(s);
var l = new yp({
shape: {
points: i
},
__sign: 0,
ignoreCoarsePointer: !0
});
e.add(l), mp(1, o, r), mp(-1, s, r), mp(0, l, r), n && (o.incremental = !0, s.incremental = !0), t && t.push(o, s);
}
function mp(r, e, t, n) {
var a = Mm(r, t) || Am(r, t), i = t.getModel("itemStyle").getItemStyle(bW);
e.useStyle(i), e.style.fill = null, e.style.stroke = a;
}
var J2 = (
/** @class */
function(r) {
O(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t.type = e.type, t.defaultValueDimensions = [{
name: "open",
defaultTooltip: !0
}, {
name: "close",
defaultTooltip: !0
}, {
name: "lowest",
defaultTooltip: !0
}, {
name: "highest",
defaultTooltip: !0
}], t;
}
return e.prototype.getShadowDim = function() {
return "open";
}, e.prototype.brushSelector = function(t, n, a) {
var i = n.getItemLayout(t);
return i && a.rect(i.brushRect);
}, e.type = "series.candlestick", e.dependencies = ["xAxis", "yAxis", "grid"], e.defaultOption = {
// zlevel: 0,
z: 2,
coordinateSystem: "cartesian2d",
legendHoverLink: !0,
// xAxisIndex: 0,
// yAxisIndex: 0,
layout: null,
clip: !0,
itemStyle: {
color: "#eb5454",
color0: "#47b262",
borderColor: "#eb5454",
borderColor0: "#47b262",
borderColorDoji: null,
// borderColor: '#d24040',
// borderColor0: '#398f4f',
borderWidth: 1
},
emphasis: {
itemStyle: {
borderWidth: 2
}
},
barMaxWidth: null,
barMinWidth: null,
barWidth: null,
large: !0,
largeThreshold: 600,
progressive: 3e3,
progressiveThreshold: 1e4,
progressiveChunkMode: "mod",
animationEasing: "linear",
animationDuration: 300
}, e;
}(Ft)
);
ie(J2, K2, !0);
function MW(r) {
!r || !z(r.series) || A(r.series, function(e) {
J(e) && e.type === "k" && (e.type = "candlestick");
});
}
var IW = {
seriesType: "candlestick",
plan: Zo(),
reset: function(r) {
var e = r.coordinateSystem, t = r.getData(), n = LW(r, t), a = 0, i = 1, o = ["x", "y"], s = t.getDimensionIndex(t.mapDimension(o[a])), l = G(t.mapDimensionsAll(o[i]), t.getDimensionIndex, t), u = l[0], h = l[1], f = l[2], c = l[3];
if (t.setLayout({
candleWidth: n,
// The value is experimented visually.
isSimpleBox: n <= 1.3
}), s < 0 || l.length < 4)
return;
return {
progress: r.pipelineContext.large ? p : v
};
function v(d, g) {
for (var y, m = g.getStore(); (y = d.next()) != null; ) {
var _ = m.get(s, y), S = m.get(u, y), x = m.get(h, y), b = m.get(f, y), w = m.get(c, y), T = Math.min(S, x), C = Math.max(S, x), D = N(T, _), M = N(C, _), I = N(b, _), L = N(w, _), E = [];
R(E, M, 0), R(E, D, 1), E.push(F(L), F(M), F(I), F(D));
var P = g.getItemModel(y), k = !!P.get(["itemStyle", "borderColorDoji"]);
g.setItemLayout(y, {
sign: eb(m, y, S, x, h, k),
initBaseline: S > x ? M[i] : D[i],
ends: E,
brushRect: V(b, w, _)
});
}
function N(H, $) {
var j = [];
return j[a] = $, j[i] = H, isNaN($) || isNaN(H) ? [NaN, NaN] : e.dataToPoint(j);
}
function R(H, $, j) {
var Q = $.slice(), st = $.slice();
Q[a] = ph(Q[a] + n / 2, 1, !1), st[a] = ph(st[a] - n / 2, 1, !0), j ? H.push(Q, st) : H.push(st, Q);
}
function V(H, $, j) {
var Q = N(H, j), st = N($, j);
return Q[a] -= n / 2, st[a] -= n / 2, {
x: Q[0],
y: Q[1],
width: n,
height: st[1] - Q[1]
};
}
function F(H) {
return H[a] = ph(H[a], 1), H;
}
}
function p(d, g) {
for (var y = Qr(d.count * 4), m = 0, _, S = [], x = [], b, w = g.getStore(), T = !!r.get(["itemStyle", "borderColorDoji"]); (b = d.next()) != null; ) {
var C = w.get(s, b), D = w.get(u, b), M = w.get(h, b), I = w.get(f, b), L = w.get(c, b);
if (isNaN(C) || isNaN(I) || isNaN(L)) {
y[m++] = NaN, m += 3;
continue;
}
y[m++] = eb(w, b, D, M, h, T), S[a] = C, S[i] = I, _ = e.dataToPoint(S, null, x), y[m++] = _ ? _[0] : NaN, y[m++] = _ ? _[1] : NaN, S[i] = L, _ = e.dataToPoint(S, null, x), y[m++] = _ ? _[1] : NaN;
}
g.setLayout("largePoints", y);
}
}
};
function eb(r, e, t, n, a, i) {
var o;
return t > n ? o = -1 : t < n ? o = 1 : o = i ? 0 : e > 0 ? r.get(a, e - 1) <= n ? 1 : -1 : 1, o;
}
function LW(r, e) {
var t = r.getBaseAxis(), n, a = t.type === "category" ? t.getBandWidth() : (n = t.getExtent(), Math.abs(n[1] - n[0]) / e.count()), i = W(ot(r.get("barMaxWidth"), a), a), o = W(ot(r.get("barMinWidth"), 1), a), s = r.get("barWidth");
return s != null ? W(s, a) : Math.max(Math.min(a / 2, i), o);
}
function EW(r) {
r.registerChartView(wW), r.registerSeriesModel(J2), r.registerPreprocessor(MW), r.registerVisual(xW), r.registerLayout(IW);
}
function rb(r, e) {
var t = e.rippleEffectColor || e.color;
r.eachChild(function(n) {
n.attr({
z: e.z,
zlevel: e.zlevel,
style: {
stroke: e.brushType === "stroke" ? t : null,
fill: e.brushType === "fill" ? t : null
}
});
});
}
var PW = (
/** @class */
function(r) {
O(e, r);
function e(t, n) {
var a = r.call(this) || this, i = new Yl(t, n), o = new at();
return a.add(i), a.add(o), a.updateData(t, n), a;
}
return e.prototype.stopEffectAnimation = function() {
this.childAt(1).removeAll();
}, e.prototype.startEffectAnimation = function(t) {
for (var n = t.symbolType, a = t.color, i = t.rippleNumber, o = this.childAt(1), s = 0; s < i; s++) {
var l = ae(n, -1, -1, 2, 2, a);
l.attr({
style: {
strokeNoScale: !0
},
z2: 99,
silent: !0,
scaleX: 0.5,
scaleY: 0.5
});
var u = -s / i * t.period + t.effectOffset;
l.animate("", !0).when(t.period, {
scaleX: t.rippleScale / 2,
scaleY: t.rippleScale / 2
}).delay(u).start(), l.animateStyle(!0).when(t.period, {
opacity: 0
}).delay(u).start(), o.add(l);
}
rb(o, t);
}, e.prototype.updateEffectAnimation = function(t) {
for (var n = this._effectCfg, a = this.childAt(1), i = ["symbolType", "period", "rippleScale", "rippleNumber"], o = 0; o < i.length; o++) {
var s = i[o];
if (n[s] !== t[s]) {
this.stopEffectAnimation(), this.startEffectAnimation(t);
return;
}
}
rb(a, t);
}, e.prototype.highlight = function() {
Mn(this);
}, e.prototype.downplay = function() {
In(this);
}, e.prototype.getSymbolType = function() {
var t = this.childAt(0);
return t && t.getSymbolType();
}, e.prototype.updateData = function(t, n) {
var a = this, i = t.hostModel;
this.childAt(0).updateData(t, n);
var o = this.childAt(1), s = t.getItemModel(n), l = t.getItemVisual(n, "symbol"), u = qo(t.getItemVisual(n, "symbolSize")), h = t.getItemVisual(n, "style"), f = h && h.fill, c = s.getModel("emphasis");
o.setScale(u), o.traverse(function(g) {
g.setStyle("fill", f);
});
var v = ki(t.getItemVisual(n, "symbolOffset"), u);
v && (o.x = v[0], o.y = v[1]);
var p = t.getItemVisual(n, "symbolRotate");
o.rotation = (p || 0) * Math.PI / 180 || 0;
var d = {};
d.showEffectOn = i.get("showEffectOn"), d.rippleScale = s.get(["rippleEffect", "scale"]), d.brushType = s.get(["rippleEffect", "brushType"]), d.period = s.get(["rippleEffect", "period"]) * 1e3, d.effectOffset = n / t.count(), d.z = i.getShallow("z") || 0, d.zlevel = i.getShallow("zlevel") || 0, d.symbolType = l, d.color = f, d.rippleEffectColor = s.get(["rippleEffect", "color"]), d.rippleNumber = s.get(["rippleEffect", "number"]), d.showEffectOn === "render" ? (this._effectCfg ? this.updateEffectAnimation(d) : this.startEffectAnimation(d), this._effectCfg = d) : (this._effectCfg = null, this.stopEffectAnimation(), this.onHoverStateChange = function(g) {
g === "emphasis" ? d.showEffectOn !== "render" && a.startEffectAnimation(d) : g === "normal" && d.showEffectOn !== "render" && a.stopEffectAnimation();
}), this._effectCfg = d, Xt(this, c.get("focus"), c.get("blurScope"), c.get("disabled"));
}, e.prototype.fadeOut = function(t) {
t && t();
}, e;
}(at)
), kW = (
/** @class */
function(r) {
O(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t.type = e.type, t;
}
return e.prototype.init = function() {
this._symbolDraw = new Zl(PW);
}, e.prototype.render = function(t, n, a) {
var i = t.getData(), o = this._symbolDraw;
o.updateData(i, {
clipShape: this._getClipShape(t)
}), this.group.add(o.group);
}, e.prototype._getClipShape = function(t) {
var n = t.coordinateSystem, a = n && n.getArea && n.getArea();
return t.get("clip", !0) ? a : null;
}, e.prototype.updateTransform = function(t, n, a) {
var i = t.getData();
this.group.dirty();
var o = ql("").reset(t, n, a);
o.progress && o.progress({
start: 0,
end: i.count(),
count: i.count()
}, i), this._symbolDraw.updateLayout();
}, e.prototype._updateGroupTransform = function(t) {
var n = t.coordinateSystem;
n && n.getRoamTransform && (this.group.transform = qE(n.getRoamTransform()), this.group.decomposeTransform());
}, e.prototype.remove = function(t, n) {
this._symbolDraw && this._symbolDraw.remove(!0);
}, e.type = "effectScatter", e;
}(kt)
), RW = (
/** @class */
function(r) {
O(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t.type = e.type, t.hasSymbolVisual = !0, t;
}
return e.prototype.getInitialData = function(t, n) {
return On(null, this, {
useEncodeDefaulter: !0
});
}, e.prototype.brushSelector = function(t, n, a) {
return a.point(n.getItemLayout(t));
}, e.type = "series.effectScatter", e.dependencies = ["grid", "polar"], e.defaultOption = {
coordinateSystem: "cartesian2d",
// zlevel: 0,
z: 2,
legendHoverLink: !0,
effectType: "ripple",
progressive: 0,
// When to show the effect, option: 'render'|'emphasis'
showEffectOn: "render",
clip: !0,
// Ripple effect config
rippleEffect: {
period: 4,
// Scale of ripple
scale: 2.5,
// Brush type can be fill or stroke
brushType: "fill",
// Ripple number
number: 3
},
universalTransition: {
divideShape: "clone"
},
// Cartesian coordinate system
// xAxisIndex: 0,
// yAxisIndex: 0,
// Polar coordinate system
// polarIndex: 0,
// Geo coordinate system
// geoIndex: 0,
// symbol: null, // 图形类型
symbolSize: 10
// 图形大小,半宽(半径)参数,当图形为方向或菱形则总宽度为symbolSize * 2
// symbolRotate: null, // 图形旋转控制
// itemStyle: {
// opacity: 1
// }
}, e;
}(Ft)
);
function NW(r) {
r.registerChartView(kW), r.registerSeriesModel(RW), r.registerLayout(ql("effectScatter"));
}
var tI = (
/** @class */
function(r) {
O(e, r);
function e(t, n, a) {
var i = r.call(this) || this;
return i.add(i.createLine(t, n, a)), i._updateEffectSymbol(t, n), i;
}
return e.prototype.createLine = function(t, n, a) {
return new mm(t, n, a);
}, e.prototype._updateEffectSymbol = function(t, n) {
var a = t.getItemModel(n), i = a.getModel("effect"), o = i.get("symbolSize"), s = i.get("symbol");
z(o) || (o = [o, o]);
var l = t.getItemVisual(n, "style"), u = i.get("color") || l && l.stroke, h = this.childAt(1);
this._symbolType !== s && (this.remove(h), h = ae(s, -0.5, -0.5, 1, 1, u), h.z2 = 100, h.culling = !0, this.add(h)), h && (h.setStyle("shadowColor", u), h.setStyle(i.getItemStyle(["color"])), h.scaleX = o[0], h.scaleY = o[1], h.setColor(u), this._symbolType = s, this._symbolScale = o, this._updateEffectAnimation(t, i, n));
}, e.prototype._updateEffectAnimation = function(t, n, a) {
var i = this.childAt(1);
if (i) {
var o = t.getItemLayout(a), s = n.get("period") * 1e3, l = n.get("loop"), u = n.get("roundTrip"), h = n.get("constantSpeed"), f = re(n.get("delay"), function(v) {
return v / t.count() * s / 3;
});
if (i.ignore = !0, this._updateAnimationPoints(i, o), h > 0 && (s = this._getLineLength(i) / h * 1e3), s !== this._period || l !== this._loop || u !== this._roundTrip) {
i.stopAnimation();
var c = void 0;
K(f) ? c = f(a) : c = f, i.__t > 0 && (c = -s * i.__t), this._animateSymbol(i, s, c, l, u);
}
this._period = s, this._loop = l, this._roundTrip = u;
}
}, e.prototype._animateSymbol = function(t, n, a, i, o) {
if (n > 0) {
t.__t = 0;
var s = this, l = t.animate("", i).when(o ? n * 2 : n, {
__t: o ? 2 : 1
}).delay(a).during(function() {
s._updateSymbolPosition(t);
});
i || l.done(function() {
s.remove(t);
}), l.start();
}
}, e.prototype._getLineLength = function(t) {
return jn(t.__p1, t.__cp1) + jn(t.__cp1, t.__p2);
}, e.prototype._updateAnimationPoints = function(t, n) {
t.__p1 = n[0], t.__p2 = n[1], t.__cp1 = n[2] || [(n[0][0] + n[1][0]) / 2, (n[0][1] + n[1][1]) / 2];
}, e.prototype.updateData = function(t, n, a) {
this.childAt(0).updateData(t, n, a), this._updateEffectSymbol(t, n);
}, e.prototype._updateSymbolPosition = function(t) {
var n = t.__p1, a = t.__p2, i = t.__cp1, o = t.__t < 1 ? t.__t : 2 - t.__t, s = [t.x, t.y], l = s.slice(), u = de, h = ad;
s[0] = u(n[0], i[0], a[0], o), s[1] = u(n[1], i[1], a[1], o);
var f = t.__t < 1 ? h(n[0], i[0], a[0], o) : h(a[0], i[0], n[0], 1 - o), c = t.__t < 1 ? h(n[1], i[1], a[1], o) : h(a[1], i[1], n[1], 1 - o);
t.rotation = -Math.atan2(c, f) - Math.PI / 2, (this._symbolType === "line" || this._symbolType === "rect" || this._symbolType === "roundRect") && (t.__lastT !== void 0 && t.__lastT < t.__t ? (t.scaleY = jn(l, s) * 1.05, o === 1 && (s[0] = l[0] + (s[0] - l[0]) / 2, s[1] = l[1] + (s[1] - l[1]) / 2)) : t.__lastT === 1 ? t.scaleY = 2 * jn(n, s) : t.scaleY = this._symbolScale[1]), t.__lastT = t.__t, t.ignore = !1, t.x = s[0], t.y = s[1];
}, e.prototype.updateLayout = function(t, n) {
this.childAt(0).updateLayout(t, n);
var a = t.getItemModel(n).getModel("effect");
this._updateEffectAnimation(t, a, n);
}, e;
}(at)
), eI = (
/** @class */
function(r) {
O(e, r);
function e(t, n, a) {
var i = r.call(this) || this;
return i._createPolyline(t, n, a), i;
}
return e.prototype._createPolyline = function(t, n, a) {
var i = t.getItemLayout(n), o = new He({
shape: {
points: i
}
});
this.add(o), this._updateCommonStl(t, n, a);
}, e.prototype.updateData = function(t, n, a) {
var i = t.hostModel, o = this.childAt(0), s = {
shape: {
points: t.getItemLayout(n)
}
};
Ct(o, s, i, n), this._updateCommonStl(t, n, a);
}, e.prototype._updateCommonStl = function(t, n, a) {
var i = this.childAt(0), o = t.getItemModel(n), s = a && a.emphasisLineStyle, l = a && a.focus, u = a && a.blurScope, h = a && a.emphasisDisabled;
if (!a || t.hasItemOption) {
var f = o.getModel("emphasis");
s = f.getModel("lineStyle").getLineStyle(), h = f.get("disabled"), l = f.get("focus"), u = f.get("blurScope");
}
i.useStyle(t.getItemVisual(n, "style")), i.style.fill = null, i.style.strokeNoScale = !0;
var c = i.ensureState("emphasis");
c.style = s, Xt(this, l, u, h);
}, e.prototype.updateLayout = function(t, n) {
var a = this.childAt(0);
a.setShape("points", t.getItemLayout(n));
}, e;
}(at)
), OW = (
/** @class */
function(r) {
O(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t._lastFrame = 0, t._lastFramePercent = 0, t;
}
return e.prototype.createLine = function(t, n, a) {
return new eI(t, n, a);
}, e.prototype._updateAnimationPoints = function(t, n) {
this._points = n;
for (var a = [0], i = 0, o = 1; o < n.length; o++) {
var s = n[o - 1], l = n[o];
i += jn(s, l), a.push(i);
}
if (i === 0) {
this._length = 0;
return;
}
for (var o = 0; o < a.length; o++)
a[o] /= i;
this._offsets = a, this._length = i;
}, e.prototype._getLineLength = function() {
return this._length;
}, e.prototype._updateSymbolPosition = function(t) {
var n = t.__t < 1 ? t.__t : 2 - t.__t, a = this._points, i = this._offsets, o = a.length;
if (i) {
var s = this._lastFrame, l;
if (n < this._lastFramePercent) {
var u = Math.min(s + 1, o - 1);
for (l = u; l >= 0 && !(i[l] <= n); l--)
;
l = Math.min(l, o - 2);
} else {
for (l = s; l < o && !(i[l] > n); l++)
;
l = Math.min(l - 1, o - 2);
}
var h = (n - i[l]) / (i[l + 1] - i[l]), f = a[l], c = a[l + 1];
t.x = f[0] * (1 - h) + h * c[0], t.y = f[1] * (1 - h) + h * c[1];
var v = t.__t < 1 ? c[0] - f[0] : f[0] - c[0], p = t.__t < 1 ? c[1] - f[1] : f[1] - c[1];
t.rotation = -Math.atan2(p, v) - Math.PI / 2, this._lastFrame = l, this._lastFramePercent = n, t.ignore = !1;
}
}, e;
}(tI)
), VW = (
/** @class */
/* @__PURE__ */ function() {
function r() {
this.polyline = !1, this.curveness = 0, this.segs = [];
}
return r;
}()
), BW = (
/** @class */
function(r) {
O(e, r);
function e(t) {
var n = r.call(this, t) || this;
return n._off = 0, n.hoverDataIdx = -1, n;
}
return e.prototype.reset = function() {
this.notClear = !1, this._off = 0;
}, e.prototype.getDefaultStyle = function() {
return {
stroke: "#000",
fill: null
};
}, e.prototype.getDefaultShape = function() {
return new VW();
}, e.prototype.buildPath = function(t, n) {
var a = n.segs, i = n.curveness, o;
if (n.polyline)
for (o = this._off; o < a.length; ) {
var s = a[o++];
if (s > 0) {
t.moveTo(a[o++], a[o++]);
for (var l = 1; l < s; l++)
t.lineTo(a[o++], a[o++]);
}
}
else
for (o = this._off; o < a.length; ) {
var u = a[o++], h = a[o++], f = a[o++], c = a[o++];
if (t.moveTo(u, h), i > 0) {
var v = (u + f) / 2 - (h - c) * i, p = (h + c) / 2 - (f - u) * i;
t.quadraticCurveTo(v, p, f, c);
} else
t.lineTo(f, c);
}
this.incremental && (this._off = o, this.notClear = !0);
}, e.prototype.findDataIndex = function(t, n) {
var a = this.shape, i = a.segs, o = a.curveness, s = this.style.lineWidth;
if (a.polyline)
for (var l = 0, u = 0; u < i.length; ) {
var h = i[u++];
if (h > 0)
for (var f = i[u++], c = i[u++], v = 1; v < h; v++) {
var p = i[u++], d = i[u++];
if (qn(f, c, p, d, s, t, n))
return l;
}
l++;
}
else
for (var l = 0, u = 0; u < i.length; ) {
var f = i[u++], c = i[u++], p = i[u++], d = i[u++];
if (o > 0) {
var g = (f + p) / 2 - (c - d) * o, y = (c + d) / 2 - (p - f) * o;
if (IC(f, c, g, y, p, d, s, t, n))
return l;
} else if (qn(f, c, p, d, s, t, n))
return l;
l++;
}
return -1;
}, e.prototype.contain = function(t, n) {
var a = this.transformCoordToLocal(t, n), i = this.getBoundingRect();
if (t = a[0], n = a[1], i.contain(t, n)) {
var o = this.hoverDataIdx = this.findDataIndex(t, n);
return o >= 0;
}
return this.hoverDataIdx = -1, !1;
}, e.prototype.getBoundingRect = function() {
var t = this._rect;
if (!t) {
for (var n = this.shape, a = n.segs, i = 1 / 0, o = 1 / 0, s = -1 / 0, l = -1 / 0, u = 0; u < a.length; ) {
var h = a[u++], f = a[u++];
i = Math.min(h, i), s = Math.max(h, s), o = Math.min(f, o), l = Math.max(f, l);
}
t = this._rect = new ct(i, o, s, l);
}
return t;
}, e;
}(mt)
), zW = (
/** @class */
function() {
function r() {
this.group = new at();
}
return r.prototype.updateData = function(e) {
this._clear();
var t = this._create();
t.setShape({
segs: e.getLayout("linesPoints")
}), this._setCommon(t, e);
}, r.prototype.incrementalPrepareUpdate = function(e) {
this.group.removeAll(), this._clear();
}, r.prototype.incrementalUpdate = function(e, t) {
var n = this._newAdded[0], a = t.getLayout("linesPoints"), i = n && n.shape.segs;
if (i && i.length < 2e4) {
var o = i.length, s = new Float32Array(o + a.length);
s.set(i), s.set(a, o), n.setShape({
segs: s
});
} else {
this._newAdded = [];
var l = this._create();
l.incremental = !0, l.setShape({
segs: a
}), this._setCommon(l, t), l.__startIndex = e.start;
}
}, r.prototype.remove = function() {
this._clear();
}, r.prototype.eachRendered = function(e) {
this._newAdded[0] && e(this._newAdded[0]);
}, r.prototype._create = function() {
var e = new BW({
cursor: "default",
ignoreCoarsePointer: !0
});
return this._newAdded.push(e), this.group.add(e), e;
}, r.prototype._setCommon = function(e, t, n) {
var a = t.hostModel;
e.setShape({
polyline: a.get("polyline"),
curveness: a.get(["lineStyle", "curveness"])
}), e.useStyle(a.getModel("lineStyle").getLineStyle()), e.style.strokeNoScale = !0;
var i = t.getVisual("style");
i && i.stroke && e.setStyle("stroke", i.stroke), e.setStyle("fill", null);
var o = it(e);
o.seriesIndex = a.seriesIndex, e.on("mousemove", function(s) {
o.dataIndex = null;
var l = e.hoverDataIdx;
l > 0 && (o.dataIndex = l + e.__startIndex);
});
}, r.prototype._clear = function() {
this._newAdded = [], this.group.removeAll();
}, r;
}()
), rI = {
seriesType: "lines",
plan: Zo(),
reset: function(r) {
var e = r.coordinateSystem;
if (!e) {
process.env.NODE_ENV !== "production" && _e("The lines series must have a coordinate system.");
return;
}
var t = r.get("polyline"), n = r.pipelineContext.large;
return {
progress: function(a, i) {
var o = [];
if (n) {
var s = void 0, l = a.end - a.start;
if (t) {
for (var u = 0, h = a.start; h < a.end; h++)
u += r.getLineCoordsCount(h);
s = new Float32Array(l + u * 2);
} else
s = new Float32Array(l * 4);
for (var f = 0, c = [], h = a.start; h < a.end; h++) {
var v = r.getLineCoords(h, o);
t && (s[f++] = v);
for (var p = 0; p < v; p++)
c = e.dataToPoint(o[p], !1, c), s[f++] = c[0], s[f++] = c[1];
}
i.setLayout("linesPoints", s);
} else
for (var h = a.start; h < a.end; h++) {
var d = i.getItemModel(h), v = r.getLineCoords(h, o), g = [];
if (t)
for (var y = 0; y < v; y++)
g.push(e.dataToPoint(o[y]));
else {
g[0] = e.dataToPoint(o[0]), g[1] = e.dataToPoint(o[1]);
var m = d.get(["lineStyle", "curveness"]);
+m && (g[2] = [(g[0][0] + g[1][0]) / 2 - (g[0][1] - g[1][1]) * m, (g[0][1] + g[1][1]) / 2 - (g[1][0] - g[0][0]) * m]);
}
i.setItemLayout(h, g);
}
}
};
}
}, GW = (
/** @class */
function(r) {
O(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t.type = e.type, t;
}
return e.prototype.render = function(t, n, a) {
var i = t.getData(), o = this._updateLineDraw(i, t), s = t.get("zlevel"), l = t.get(["effect", "trailLength"]), u = a.getZr(), h = u.painter.getType() === "svg";
h || u.painter.getLayer(s).clear(!0), this._lastZlevel != null && !h && u.configLayer(this._lastZlevel, {
motionBlur: !1
}), this._showEffect(t) && l > 0 && (h ? process.env.NODE_ENV !== "production" && console.warn("SVG render mode doesn't support lines with trail effect") : u.configLayer(s, {
motionBlur: !0,
lastFrameAlpha: Math.max(Math.min(l / 10 + 0.9, 1), 0)
})), o.updateData(i);
var f = t.get("clip", !0) && Xl(t.coordinateSystem, !1, t);
f ? this.group.setClipPath(f) : this.group.removeClipPath(), this._lastZlevel = s, this._finished = !0;
}, e.prototype.incrementalPrepareRender = function(t, n, a) {
var i = t.getData(), o = this._updateLineDraw(i, t);
o.incrementalPrepareUpdate(i), this._clearLayer(a), this._finished = !1;
}, e.prototype.incrementalRender = function(t, n, a) {
this._lineDraw.incrementalUpdate(t, n.getData()), this._finished = t.end === n.getData().count();
}, e.prototype.eachRendered = function(t) {
this._lineDraw && this._lineDraw.eachRendered(t);
}, e.prototype.updateTransform = function(t, n, a) {
var i = t.getData(), o = t.pipelineContext;
if (!this._finished || o.large || o.progressiveRender)
return {
update: !0
};
var s = rI.reset(t, n, a);
s.progress && s.progress({
start: 0,
end: i.count(),
count: i.count()
}, i), this._lineDraw.updateLayout(), this._clearLayer(a);
}, e.prototype._updateLineDraw = function(t, n) {
var a = this._lineDraw, i = this._showEffect(n), o = !!n.get("polyline"), s = n.pipelineContext, l = s.large;
return process.env.NODE_ENV !== "production" && i && l && console.warn("Large lines not support effect"), (!a || i !== this._hasEffet || o !== this._isPolyline || l !== this._isLargeDraw) && (a && a.remove(), a = this._lineDraw = l ? new zW() : new _m(o ? i ? OW : eI : i ? tI : mm), this._hasEffet = i, this._isPolyline = o, this._isLargeDraw = l), this.group.add(a.group), a;
}, e.prototype._showEffect = function(t) {
return !!t.get(["effect", "show"]);
}, e.prototype._clearLayer = function(t) {
var n = t.getZr(), a = n.painter.getType() === "svg";
!a && this._lastZlevel != null && n.painter.getLayer(this._lastZlevel).clear(!0);
}, e.prototype.remove = function(t, n) {
this._lineDraw && this._lineDraw.remove(), this._lineDraw = null, this._clearLayer(n);
}, e.prototype.dispose = function(t, n) {
this.remove(t, n);
}, e.type = "lines", e;
}(kt)
), FW = typeof Uint32Array > "u" ? Array : Uint32Array, HW = typeof Float64Array > "u" ? Array : Float64Array;
function nb(r) {
var e = r.data;
e && e[0] && e[0][0] && e[0][0].coord && (process.env.NODE_ENV !== "production" && console.warn("Lines data configuration has been changed to { coords:[[1,2],[2,3]] }"), r.data = G(e, function(t) {
var n = [t[0].coord, t[1].coord], a = {
coords: n
};
return t[0].name && (a.fromName = t[0].name), t[1].name && (a.toName = t[1].name), Qg([a, t[0], t[1]]);
}));
}
var WW = (
/** @class */
function(r) {
O(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t.type = e.type, t.visualStyleAccessPath = "lineStyle", t.visualDrawType = "stroke", t;
}
return e.prototype.init = function(t) {
t.data = t.data || [], nb(t);
var n = this._processFlatCoordsArray(t.data);
this._flatCoords = n.flatCoords, this._flatCoordsOffset = n.flatCoordsOffset, n.flatCoords && (t.data = new Float32Array(n.count)), r.prototype.init.apply(this, arguments);
}, e.prototype.mergeOption = function(t) {
if (nb(t), t.data) {
var n = this._processFlatCoordsArray(t.data);
this._flatCoords = n.flatCoords, this._flatCoordsOffset = n.flatCoordsOffset, n.flatCoords && (t.data = new Float32Array(n.count));
}
r.prototype.mergeOption.apply(this, arguments);
}, e.prototype.appendData = function(t) {
var n = this._processFlatCoordsArray(t.data);
n.flatCoords && (this._flatCoords ? (this._flatCoords = ol(this._flatCoords, n.flatCoords), this._flatCoordsOffset = ol(this._flatCoordsOffset, n.flatCoordsOffset)) : (this._flatCoords = n.flatCoords, this._flatCoordsOffset = n.flatCoordsOffset), t.data = new Float32Array(n.count)), this.getRawData().appendData(t.data);
}, e.prototype._getCoordsFromItemModel = function(t) {
var n = this.getData().getItemModel(t), a = n.option instanceof Array ? n.option : n.getShallow("coords");
if (process.env.NODE_ENV !== "production" && !(a instanceof Array && a.length > 0 && a[0] instanceof Array))
throw new Error("Invalid coords " + JSON.stringify(a) + ". Lines must have 2d coords array in data item.");
return a;
}, e.prototype.getLineCoordsCount = function(t) {
return this._flatCoordsOffset ? this._flatCoordsOffset[t * 2 + 1] : this._getCoordsFromItemModel(t).length;
}, e.prototype.getLineCoords = function(t, n) {
if (this._flatCoordsOffset) {
for (var a = this._flatCoordsOffset[t * 2], i = this._flatCoordsOffset[t * 2 + 1], o = 0; o < i; o++)
n[o] = n[o] || [], n[o][0] = this._flatCoords[a + o * 2], n[o][1] = this._flatCoords[a + o * 2 + 1];
return i;
} else {
for (var s = this._getCoordsFromItemModel(t), o = 0; o < s.length; o++)
n[o] = n[o] || [], n[o][0] = s[o][0], n[o][1] = s[o][1];
return s.length;
}
}, e.prototype._processFlatCoordsArray = function(t) {
var n = 0;
if (this._flatCoords && (n = this._flatCoords.length), Tt(t[0])) {
for (var a = t.length, i = new FW(a), o = new HW(a), s = 0, l = 0, u = 0, h = 0; h < a; ) {
u++;
var f = t[h++];
i[l++] = s + n, i[l++] = f;
for (var c = 0; c < f; c++) {
var v = t[h++], p = t[h++];
if (o[s++] = v, o[s++] = p, h > a && process.env.NODE_ENV !== "production")
throw new Error("Invalid data format.");
}
}
return {
flatCoordsOffset: new Uint32Array(i.buffer, 0, l),
flatCoords: o,
count: u
};
}
return {
flatCoordsOffset: null,
flatCoords: null,
count: t.length
};
}, e.prototype.getInitialData = function(t, n) {
if (process.env.NODE_ENV !== "production") {
var a = Yo.get(t.coordinateSystem);
if (!a)
throw new Error("Unknown coordinate system " + t.coordinateSystem);
}
var i = new Ne(["value"], this);
return i.hasItemOption = !1, i.initData(t.data, [], function(o, s, l, u) {
if (o instanceof Array)
return NaN;
i.hasItemOption = !0;
var h = o.value;
if (h != null)
return h instanceof Array ? h[u] : h;
}), i;
}, e.prototype.formatTooltip = function(t, n, a) {
var i = this.getData(), o = i.getItemModel(t), s = o.get("name");
if (s)
return s;
var l = o.get("fromName"), u = o.get("toName"), h = [];
return l != null && h.push(l), u != null && h.push(u), pe("nameValue", {
name: h.join(" > ")
});
}, e.prototype.preventIncremental = function() {
return !!this.get(["effect", "show"]);
}, e.prototype.getProgressive = function() {
var t = this.option.progressive;
return t ?? (this.option.large ? 1e4 : this.get("progressive"));
}, e.prototype.getProgressiveThreshold = function() {
var t = this.option.progressiveThreshold;
return t ?? (this.option.large ? 2e4 : this.get("progressiveThreshold"));
}, e.prototype.getZLevelKey = function() {
var t = this.getModel("effect"), n = t.get("trailLength");
return this.getData().count() > this.getProgressiveThreshold() ? this.id : t.get("show") && n > 0 ? n + "" : "";
}, e.type = "series.lines", e.dependencies = ["grid", "polar", "geo", "calendar"], e.defaultOption = {
coordinateSystem: "geo",
// zlevel: 0,
z: 2,
legendHoverLink: !0,
// Cartesian coordinate system
xAxisIndex: 0,
yAxisIndex: 0,
symbol: ["none", "none"],
symbolSize: [10, 10],
// Geo coordinate system
geoIndex: 0,
effect: {
show: !1,
period: 4,
constantSpeed: 0,
symbol: "circle",
symbolSize: 3,
loop: !0,
trailLength: 0.2
},
large: !1,
// Available when large is true
largeThreshold: 2e3,
polyline: !1,
clip: !0,
label: {
show: !1,
position: "end"
// distance: 5,
// formatter: 标签文本格式器,同Tooltip.formatter,不支持异步回调
},
lineStyle: {
opacity: 0.5
}
}, e;
}(Ft)
);
function Zu(r) {
return r instanceof Array || (r = [r, r]), r;
}
var $W = {
seriesType: "lines",
reset: function(r) {
var e = Zu(r.get("symbol")), t = Zu(r.get("symbolSize")), n = r.getData();
n.setVisual("fromSymbol", e && e[0]), n.setVisual("toSymbol", e && e[1]), n.setVisual("fromSymbolSize", t && t[0]), n.setVisual("toSymbolSize", t && t[1]);
function a(i, o) {
var s = i.getItemModel(o), l = Zu(s.getShallow("symbol", !0)), u = Zu(s.getShallow("symbolSize", !0));
l[0] && i.setItemVisual(o, "fromSymbol", l[0]), l[1] && i.setItemVisual(o, "toSymbol", l[1]), u[0] && i.setItemVisual(o, "fromSymbolSize", u[0]), u[1] && i.setItemVisual(o, "toSymbolSize", u[1]);
}
return {
dataEach: n.hasItemOption ? a : null
};
}
};
function UW(r) {
r.registerChartView(GW), r.registerSeriesModel(WW), r.registerLayout(rI), r.registerVisual($W);
}
var YW = 256, ZW = (
/** @class */
function() {
function r() {
this.blurSize = 30, this.pointSize = 20, this.maxOpacity = 1, this.minOpacity = 0, this._gradientPixels = {
inRange: null,
outOfRange: null
};
var e = ha.createCanvas();
this.canvas = e;
}
return r.prototype.update = function(e, t, n, a, i, o) {
var s = this._getBrush(), l = this._getGradient(i, "inRange"), u = this._getGradient(i, "outOfRange"), h = this.pointSize + this.blurSize, f = this.canvas, c = f.getContext("2d"), v = e.length;
f.width = t, f.height = n;
for (var p = 0; p < v; ++p) {
var d = e[p], g = d[0], y = d[1], m = d[2], _ = a(m);
c.globalAlpha = _, c.drawImage(s, g - h, y - h);
}
if (!f.width || !f.height)
return f;
for (var S = c.getImageData(0, 0, f.width, f.height), x = S.data, b = 0, w = x.length, T = this.minOpacity, C = this.maxOpacity, D = C - T; b < w; ) {
var _ = x[b + 3] / 256, M = Math.floor(_ * (YW - 1)) * 4;
if (_ > 0) {
var I = o(_) ? l : u;
_ > 0 && (_ = _ * D + T), x[b++] = I[M], x[b++] = I[M + 1], x[b++] = I[M + 2], x[b++] = I[M + 3] * _ * 256;
} else
b += 4;
}
return c.putImageData(S, 0, 0), f;
}, r.prototype._getBrush = function() {
var e = this._brushCanvas || (this._brushCanvas = ha.createCanvas()), t = this.pointSize + this.blurSize, n = t * 2;
e.width = n, e.height = n;
var a = e.getContext("2d");
return a.clearRect(0, 0, n, n), a.shadowOffsetX = n, a.shadowBlur = this.blurSize, a.shadowColor = "#000", a.beginPath(), a.arc(-t, t, this.pointSize, 0, Math.PI * 2, !0), a.closePath(), a.fill(), e;
}, r.prototype._getGradient = function(e, t) {
for (var n = this._gradientPixels, a = n[t] || (n[t] = new Uint8ClampedArray(256 * 4)), i = [0, 0, 0, 0], o = 0, s = 0; s < 256; s++)
e[t](s / 255, !0, i), a[o++] = i[0], a[o++] = i[1], a[o++] = i[2], a[o++] = i[3];
return a;
}, r;
}()
);
function XW(r, e, t) {
var n = r[1] - r[0];
e = G(e, function(o) {
return {
interval: [(o.interval[0] - r[0]) / n, (o.interval[1] - r[0]) / n]
};
});
var a = e.length, i = 0;
return function(o) {
var s;
for (s = i; s < a; s++) {
var l = e[s].interval;
if (l[0] <= o && o <= l[1]) {
i = s;
break;
}
}
if (s === a)
for (s = i - 1; s >= 0; s--) {
var l = e[s].interval;
if (l[0] <= o && o <= l[1]) {
i = s;
break;
}
}
return s >= 0 && s < a && t[s];
};
}
function qW(r, e) {
var t = r[1] - r[0];
return e = [(e[0] - r[0]) / t, (e[1] - r[0]) / t], function(n) {
return n >= e[0] && n <= e[1];
};
}
function ab(r) {
var e = r.dimensions;
return e[0] === "lng" && e[1] === "lat";
}
var KW = (
/** @class */
function(r) {
O(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t.type = e.type, t;
}
return e.prototype.render = function(t, n, a) {
var i;
if (n.eachComponent("visualMap", function(s) {
s.eachTargetSeries(function(l) {
l === t && (i = s);
});
}), process.env.NODE_ENV !== "production" && !i)
throw new Error("Heatmap must use with visualMap");
this._progressiveEls = null, this.group.removeAll();
var o = t.coordinateSystem;
o.type === "cartesian2d" || o.type === "calendar" ? this._renderOnCartesianAndCalendar(t, a, 0, t.getData().count()) : ab(o) && this._renderOnGeo(o, t, i, a);
}, e.prototype.incrementalPrepareRender = function(t, n, a) {
this.group.removeAll();
}, e.prototype.incrementalRender = function(t, n, a, i) {
var o = n.coordinateSystem;
o && (ab(o) ? this.render(n, a, i) : (this._progressiveEls = [], this._renderOnCartesianAndCalendar(n, i, t.start, t.end, !0)));
}, e.prototype.eachRendered = function(t) {
ma(this._progressiveEls || this.group, t);
}, e.prototype._renderOnCartesianAndCalendar = function(t, n, a, i, o) {
var s = t.coordinateSystem, l = Ni(s, "cartesian2d"), u, h, f, c;
if (l) {
var v = s.getAxis("x"), p = s.getAxis("y");
if (process.env.NODE_ENV !== "production") {
if (!(v.type === "category" && p.type === "category"))
throw new Error("Heatmap on cartesian must have two category axes");
if (!(v.onBand && p.onBand))
throw new Error("Heatmap on cartesian must have two axes with boundaryGap true");
}
u = v.getBandWidth() + 0.5, h = p.getBandWidth() + 0.5, f = v.scale.getExtent(), c = p.scale.getExtent();
}
for (var d = this.group, g = t.getData(), y = t.getModel(["emphasis", "itemStyle"]).getItemStyle(), m = t.getModel(["blur", "itemStyle"]).getItemStyle(), _ = t.getModel(["select", "itemStyle"]).getItemStyle(), S = t.get(["itemStyle", "borderRadius"]), x = ve(t), b = t.getModel("emphasis"), w = b.get("focus"), T = b.get("blurScope"), C = b.get("disabled"), D = l ? [g.mapDimension("x"), g.mapDimension("y"), g.mapDimension("value")] : [g.mapDimension("time"), g.mapDimension("value")], M = a; M < i; M++) {
var I = void 0, L = g.getItemVisual(M, "style");
if (l) {
var E = g.get(D[0], M), P = g.get(D[1], M);
if (isNaN(g.get(D[2], M)) || isNaN(E) || isNaN(P) || E < f[0] || E > f[1] || P < c[0] || P > c[1])
continue;
var k = s.dataToPoint([E, P]);
I = new xt({
shape: {
x: k[0] - u / 2,
y: k[1] - h / 2,
width: u,
height: h
},
style: L
});
} else {
if (isNaN(g.get(D[1], M)))
continue;
I = new xt({
z2: 1,
shape: s.dataToRect([g.get(D[0], M)]).contentShape,
style: L
});
}
if (g.hasItemOption) {
var N = g.getItemModel(M), R = N.getModel("emphasis");
y = R.getModel("itemStyle").getItemStyle(), m = N.getModel(["blur", "itemStyle"]).getItemStyle(), _ = N.getModel(["select", "itemStyle"]).getItemStyle(), S = N.get(["itemStyle", "borderRadius"]), w = R.get("focus"), T = R.get("blurScope"), C = R.get("disabled"), x = ve(N);
}
I.shape.r = S;
var V = t.getRawValue(M), F = "-";
V && V[2] != null && (F = V[2] + ""), xe(I, x, {
labelFetcher: t,
labelDataIndex: M,
defaultOpacity: L.opacity,
defaultText: F
}), I.ensureState("emphasis").style = y, I.ensureState("blur").style = m, I.ensureState("select").style = _, Xt(I, w, T, C), I.incremental = o, o && (I.states.emphasis.hoverLayer = !0), d.add(I), g.setItemGraphicEl(M, I), this._progressiveEls && this._progressiveEls.push(I);
}
}, e.prototype._renderOnGeo = function(t, n, a, i) {
var o = a.targetVisuals.inRange, s = a.targetVisuals.outOfRange, l = n.getData(), u = this._hmLayer || this._hmLayer || new ZW();
u.blurSize = n.get("blurSize"), u.pointSize = n.get("pointSize"), u.minOpacity = n.get("minOpacity"), u.maxOpacity = n.get("maxOpacity");
var h = t.getViewRect().clone(), f = t.getRoamTransform();
h.applyTransform(f);
var c = Math.max(h.x, 0), v = Math.max(h.y, 0), p = Math.min(h.width + h.x, i.getWidth()), d = Math.min(h.height + h.y, i.getHeight()), g = p - c, y = d - v, m = [l.mapDimension("lng"), l.mapDimension("lat"), l.mapDimension("value")], _ = l.mapArray(m, function(w, T, C) {
var D = t.dataToPoint([w, T]);
return D[0] -= c, D[1] -= v, D.push(C), D;
}), S = a.getExtent(), x = a.type === "visualMap.continuous" ? qW(S, a.option.range) : XW(S, a.getPieceList(), a.option.selected);
u.update(_, g, y, o.color.getNormalizer(), {
inRange: o.color.getColorMapper(),
outOfRange: s.color.getColorMapper()
}, x);
var b = new ge({
style: {
width: g,
height: y,
x: c,
y: v,
image: u.canvas
},
silent: !0
});
this.group.add(b);
}, e.type = "heatmap", e;
}(kt)
), jW = (
/** @class */
function(r) {
O(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t.type = e.type, t;
}
return e.prototype.getInitialData = function(t, n) {
return On(null, this, {
generateCoord: "value"
});
}, e.prototype.preventIncremental = function() {
var t = Yo.get(this.get("coordinateSystem"));
if (t && t.dimensions)
return t.dimensions[0] === "lng" && t.dimensions[1] === "lat";
}, e.type = "series.heatmap", e.dependencies = ["grid", "geo", "calendar"], e.defaultOption = {
coordinateSystem: "cartesian2d",
// zlevel: 0,
z: 2,
// Cartesian coordinate system
// xAxisIndex: 0,
// yAxisIndex: 0,
// Geo coordinate system
geoIndex: 0,
blurSize: 30,
pointSize: 20,
maxOpacity: 1,
minOpacity: 0,
select: {
itemStyle: {
borderColor: "#212121"
}
}
}, e;
}(Ft)
);
function QW(r) {
r.registerChartView(KW), r.registerSeriesModel(jW);
}
var JW = ["itemStyle", "borderWidth"], ib = [{
xy: "x",
wh: "width",
index: 0,
posDesc: ["left", "right"]
}, {
xy: "y",
wh: "height",
index: 1,
posDesc: ["top", "bottom"]
}], _p = new Nn(), t6 = (
/** @class */
function(r) {
O(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t.type = e.type, t;
}
return e.prototype.render = function(t, n, a) {
var i = this.group, o = t.getData(), s = this._data, l = t.coordinateSystem, u = l.getBaseAxis(), h = u.isHorizontal(), f = l.master.getRect(), c = {
ecSize: {
width: a.getWidth(),
height: a.getHeight()
},
seriesModel: t,
coordSys: l,
coordSysExtent: [[f.x, f.x + f.width], [f.y, f.y + f.height]],
isHorizontal: h,
valueDim: ib[+h],
categoryDim: ib[1 - +h]
};
o.diff(s).add(function(p) {
if (o.hasValue(p)) {
var d = sb(o, p), g = ob(o, p, d, c), y = lb(o, c, g);
o.setItemGraphicEl(p, y), i.add(y), hb(y, c, g);
}
}).update(function(p, d) {
var g = s.getItemGraphicEl(d);
if (!o.hasValue(p)) {
i.remove(g);
return;
}
var y = sb(o, p), m = ob(o, p, y, c), _ = lI(o, m);
g && _ !== g.__pictorialShapeStr && (i.remove(g), o.setItemGraphicEl(p, null), g = null), g ? s6(g, c, m) : g = lb(o, c, m, !0), o.setItemGraphicEl(p, g), g.__pictorialSymbolMeta = m, i.add(g), hb(g, c, m);
}).remove(function(p) {
var d = s.getItemGraphicEl(p);
d && ub(s, p, d.__pictorialSymbolMeta.animationModel, d);
}).execute();
var v = t.get("clip", !0) ? Xl(t.coordinateSystem, !1, t) : null;
return v ? i.setClipPath(v) : i.removeClipPath(), this._data = o, this.group;
}, e.prototype.remove = function(t, n) {
var a = this.group, i = this._data;
t.get("animation") ? i && i.eachItemGraphicEl(function(o) {
ub(i, it(o).dataIndex, t, o);
}) : a.removeAll();
}, e.type = "pictorialBar", e;
}(kt)
);
function ob(r, e, t, n) {
var a = r.getItemLayout(e), i = t.get("symbolRepeat"), o = t.get("symbolClip"), s = t.get("symbolPosition") || "start", l = t.get("symbolRotate"), u = (l || 0) * Math.PI / 180 || 0, h = t.get("symbolPatternSize") || 2, f = t.isAnimationEnabled(), c = {
dataIndex: e,
layout: a,
itemModel: t,
symbolType: r.getItemVisual(e, "symbol") || "circle",
style: r.getItemVisual(e, "style"),
symbolClip: o,
symbolRepeat: i,
symbolRepeatDirection: t.get("symbolRepeatDirection"),
symbolPatternSize: h,
rotation: u,
animationModel: f ? t : null,
hoverScale: f && t.get(["emphasis", "scale"]),
z2: t.getShallow("z", !0) || 0
};
e6(t, i, a, n, c), r6(r, e, a, i, o, c.boundingLength, c.pxSign, h, n, c), n6(t, c.symbolScale, u, n, c);
var v = c.symbolSize, p = ki(t.get("symbolOffset"), v);
return a6(t, v, a, i, o, p, s, c.valueLineWidth, c.boundingLength, c.repeatCutLength, n, c), c;
}
function e6(r, e, t, n, a) {
var i = n.valueDim, o = r.get("symbolBoundingData"), s = n.coordSys.getOtherAxis(n.coordSys.getBaseAxis()), l = s.toGlobalCoord(s.dataToCoord(0)), u = 1 - +(t[i.wh] <= 0), h;
if (z(o)) {
var f = [Sp(s, o[0]) - l, Sp(s, o[1]) - l];
f[1] < f[0] && f.reverse(), h = f[u];
} else o != null ? h = Sp(s, o) - l : e ? h = n.coordSysExtent[i.index][u] - l : h = t[i.wh];
a.boundingLength = h, e && (a.repeatCutLength = t[i.wh]);
var c = i.xy === "x", v = s.inverse;
a.pxSign = c && !v || !c && v ? h >= 0 ? 1 : -1 : h > 0 ? 1 : -1;
}
function Sp(r, e) {
return r.toGlobalCoord(r.dataToCoord(r.scale.parse(e)));
}
function r6(r, e, t, n, a, i, o, s, l, u) {
var h = l.valueDim, f = l.categoryDim, c = Math.abs(t[f.wh]), v = r.getItemVisual(e, "symbolSize"), p;
z(v) ? p = v.slice() : v == null ? p = ["100%", "100%"] : p = [v, v], p[f.index] = W(p[f.index], c), p[h.index] = W(p[h.index], n ? c : Math.abs(i)), u.symbolSize = p;
var d = u.symbolScale = [p[0] / s, p[1] / s];
d[h.index] *= (l.isHorizontal ? -1 : 1) * o;
}
function n6(r, e, t, n, a) {
var i = r.get(JW) || 0;
i && (_p.attr({
scaleX: e[0],
scaleY: e[1],
rotation: t
}), _p.updateTransform(), i /= _p.getLineScale(), i *= e[n.valueDim.index]), a.valueLineWidth = i || 0;
}
function a6(r, e, t, n, a, i, o, s, l, u, h, f) {
var c = h.categoryDim, v = h.valueDim, p = f.pxSign, d = Math.max(e[v.index] + s, 0), g = d;
if (n) {
var y = Math.abs(l), m = re(r.get("symbolMargin"), "15%") + "", _ = !1;
m.lastIndexOf("!") === m.length - 1 && (_ = !0, m = m.slice(0, m.length - 1));
var S = W(m, e[v.index]), x = Math.max(d + S * 2, 0), b = _ ? 0 : S * 2, w = sy(n), T = w ? n : fb((y + b) / x), C = y - T * d;
S = C / 2 / (_ ? T : Math.max(T - 1, 1)), x = d + S * 2, b = _ ? 0 : S * 2, !w && n !== "fixed" && (T = u ? fb((Math.abs(u) + b) / x) : 0), g = T * x - b, f.repeatTimes = T, f.symbolMargin = S;
}
var D = p * (g / 2), M = f.pathPosition = [];
M[c.index] = t[c.wh] / 2, M[v.index] = o === "start" ? D : o === "end" ? l - D : l / 2, i && (M[0] += i[0], M[1] += i[1]);
var I = f.bundlePosition = [];
I[c.index] = t[c.xy], I[v.index] = t[v.xy];
var L = f.barRectShape = B({}, t);
L[v.wh] = p * Math.max(Math.abs(t[v.wh]), Math.abs(M[v.index] + D)), L[c.wh] = t[c.wh];
var E = f.clipShape = {};
E[c.xy] = -t[c.xy], E[c.wh] = h.ecSize[c.wh], E[v.xy] = 0, E[v.wh] = t[v.wh];
}
function nI(r) {
var e = r.symbolPatternSize, t = ae(
// Consider texture img, make a big size.
r.symbolType,
-e / 2,
-e / 2,
e,
e
);
return t.attr({
culling: !0
}), t.type !== "image" && t.setStyle({
strokeNoScale: !0
}), t;
}
function aI(r, e, t, n) {
var a = r.__pictorialBundle, i = t.symbolSize, o = t.valueLineWidth, s = t.pathPosition, l = e.valueDim, u = t.repeatTimes || 0, h = 0, f = i[e.valueDim.index] + o + t.symbolMargin * 2;
for (Im(r, function(d) {
d.__pictorialAnimationIndex = h, d.__pictorialRepeatTimes = u, h < u ? wo(d, null, p(h), t, n) : wo(d, null, {
scaleX: 0,
scaleY: 0
}, t, n, function() {
a.remove(d);
}), h++;
}); h < u; h++) {
var c = nI(t);
c.__pictorialAnimationIndex = h, c.__pictorialRepeatTimes = u, a.add(c);
var v = p(h);
wo(c, {
x: v.x,
y: v.y,
scaleX: 0,
scaleY: 0
}, {
scaleX: v.scaleX,
scaleY: v.scaleY,
rotation: v.rotation
}, t, n);
}
function p(d) {
var g = s.slice(), y = t.pxSign, m = d;
return (t.symbolRepeatDirection === "start" ? y > 0 : y < 0) && (m = u - 1 - d), g[l.index] = f * (m - u / 2 + 0.5) + s[l.index], {
x: g[0],
y: g[1],
scaleX: t.symbolScale[0],
scaleY: t.symbolScale[1],
rotation: t.rotation
};
}
}
function iI(r, e, t, n) {
var a = r.__pictorialBundle, i = r.__pictorialMainPath;
i ? wo(i, null, {
x: t.pathPosition[0],
y: t.pathPosition[1],
scaleX: t.symbolScale[0],
scaleY: t.symbolScale[1],
rotation: t.rotation
}, t, n) : (i = r.__pictorialMainPath = nI(t), a.add(i), wo(i, {
x: t.pathPosition[0],
y: t.pathPosition[1],
scaleX: 0,
scaleY: 0,
rotation: t.rotation
}, {
scaleX: t.symbolScale[0],
scaleY: t.symbolScale[1]
}, t, n));
}
function oI(r, e, t) {
var n = B({}, e.barRectShape), a = r.__pictorialBarRect;
a ? wo(a, null, {
shape: n
}, e, t) : (a = r.__pictorialBarRect = new xt({
z2: 2,
shape: n,
silent: !0,
style: {
stroke: "transparent",
fill: "transparent",
lineWidth: 0
}
}), a.disableMorphing = !0, r.add(a));
}
function sI(r, e, t, n) {
if (t.symbolClip) {
var a = r.__pictorialClipPath, i = B({}, t.clipShape), o = e.valueDim, s = t.animationModel, l = t.dataIndex;
if (a)
Ct(a, {
shape: i
}, s, l);
else {
i[o.wh] = 0, a = new xt({
shape: i
}), r.__pictorialBundle.setClipPath(a), r.__pictorialClipPath = a;
var u = {};
u[o.wh] = t.clipShape[o.wh], Pi[n ? "updateProps" : "initProps"](a, {
shape: u
}, s, l);
}
}
}
function sb(r, e) {
var t = r.getItemModel(e);
return t.getAnimationDelayParams = i6, t.isAnimationEnabled = o6, t;
}
function i6(r) {
return {
index: r.__pictorialAnimationIndex,
count: r.__pictorialRepeatTimes
};
}
function o6() {
return this.parentModel.isAnimationEnabled() && !!this.getShallow("animation");
}
function lb(r, e, t, n) {
var a = new at(), i = new at();
return a.add(i), a.__pictorialBundle = i, i.x = t.bundlePosition[0], i.y = t.bundlePosition[1], t.symbolRepeat ? aI(a, e, t) : iI(a, e, t), oI(a, t, n), sI(a, e, t, n), a.__pictorialShapeStr = lI(r, t), a.__pictorialSymbolMeta = t, a;
}
function s6(r, e, t) {
var n = t.animationModel, a = t.dataIndex, i = r.__pictorialBundle;
Ct(i, {
x: t.bundlePosition[0],
y: t.bundlePosition[1]
}, n, a), t.symbolRepeat ? aI(r, e, t, !0) : iI(r, e, t, !0), oI(r, t, !0), sI(r, e, t, !0);
}
function ub(r, e, t, n) {
var a = n.__pictorialBarRect;
a && a.removeTextContent();
var i = [];
Im(n, function(o) {
i.push(o);
}), n.__pictorialMainPath && i.push(n.__pictorialMainPath), n.__pictorialClipPath && (t = null), A(i, function(o) {
va(o, {
scaleX: 0,
scaleY: 0
}, t, e, function() {
n.parent && n.parent.remove(n);
});
}), r.setItemGraphicEl(e, null);
}
function lI(r, e) {
return [r.getItemVisual(e.dataIndex, "symbol") || "none", !!e.symbolRepeat, !!e.symbolClip].join(":");
}
function Im(r, e, t) {
A(r.__pictorialBundle.children(), function(n) {
n !== r.__pictorialBarRect && e.call(t, n);
});
}
function wo(r, e, t, n, a, i) {
e && r.attr(e), n.symbolClip && !a ? t && r.attr(t) : t && Pi[a ? "updateProps" : "initProps"](r, t, n.animationModel, n.dataIndex, i);
}
function hb(r, e, t) {
var n = t.dataIndex, a = t.itemModel, i = a.getModel("emphasis"), o = i.getModel("itemStyle").getItemStyle(), s = a.getModel(["blur", "itemStyle"]).getItemStyle(), l = a.getModel(["select", "itemStyle"]).getItemStyle(), u = a.getShallow("cursor"), h = i.get("focus"), f = i.get("blurScope"), c = i.get("scale");
Im(r, function(d) {
if (d instanceof ge) {
var g = d.style;
d.useStyle(B({
// TODO other properties like dx, dy ?
image: g.image,
x: g.x,
y: g.y,
width: g.width,
height: g.height
}, t.style));
} else
d.useStyle(t.style);
var y = d.ensureState("emphasis");
y.style = o, c && (y.scaleX = d.scaleX * 1.1, y.scaleY = d.scaleY * 1.1), d.ensureState("blur").style = s, d.ensureState("select").style = l, u && (d.cursor = u), d.z2 = t.z2;
});
var v = e.valueDim.posDesc[+(t.boundingLength > 0)], p = r.__pictorialBarRect;
p.ignoreClip = !0, xe(p, ve(a), {
labelFetcher: e.seriesModel,
labelDataIndex: n,
defaultText: Lo(e.seriesModel.getData(), n),
inheritColor: t.style.fill,
defaultOpacity: t.style.opacity,
defaultOutsidePosition: v
}), Xt(r, h, f, i.get("disabled"));
}
function fb(r) {
var e = Math.round(r);
return Math.abs(r - e) < 1e-4 ? e : Math.ceil(r);
}
var l6 = (
/** @class */
function(r) {
O(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t.type = e.type, t.hasSymbolVisual = !0, t.defaultSymbol = "roundRect", t;
}
return e.prototype.getInitialData = function(t) {
return t.stack = null, r.prototype.getInitialData.apply(this, arguments);
}, e.type = "series.pictorialBar", e.dependencies = ["grid"], e.defaultOption = _a(bl.defaultOption, {
symbol: "circle",
symbolSize: null,
symbolRotate: null,
symbolPosition: null,
symbolOffset: null,
symbolMargin: null,
symbolRepeat: !1,
symbolRepeatDirection: "end",
symbolClip: !1,
symbolBoundingData: null,
symbolPatternSize: 400,
barGap: "-100%",
// Pictorial bar do not clip by default because in many cases
// xAxis and yAxis are not displayed and it's expected not to clip
clip: !1,
// z can be set in data item, which is z2 actually.
// Disable progressive
progressive: 0,
emphasis: {
// By default pictorialBar do not hover scale. Hover scale is not suitable
// for the case that both has foreground and background.
scale: !1
},
select: {
itemStyle: {
borderColor: "#212121"
}
}
}), e;
}(bl)
);
function u6(r) {
r.registerChartView(t6), r.registerSeriesModel(l6), r.registerLayout(r.PRIORITY.VISUAL.LAYOUT, ut(UA, "pictorialBar")), r.registerLayout(r.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT, YA("pictorialBar"));
}
var h6 = (
/** @class */
function(r) {
O(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t.type = e.type, t._layers = [], t;
}
return e.prototype.render = function(t, n, a) {
var i = t.getData(), o = this, s = this.group, l = t.getLayerSeries(), u = i.getLayout("layoutInfo"), h = u.rect, f = u.boundaryGap;
s.x = 0, s.y = h.y + f[0];
function c(g) {
return g.name;
}
var v = new Ln(this._layersSeries || [], l, c, c), p = [];
v.add(Y(d, this, "add")).update(Y(d, this, "update")).remove(Y(d, this, "remove")).execute();
function d(g, y, m) {
var _ = o._layers;
if (g === "remove") {
s.remove(_[y]);
return;
}
for (var S = [], x = [], b, w = l[y].indices, T = 0; T < w.length; T++) {
var C = i.getItemLayout(w[T]), D = C.x, M = C.y0, I = C.y;
S.push(D, M), x.push(D, M + I), b = i.getItemVisual(w[T], "style");
}
var L, E = i.getItemLayout(w[0]), P = t.getModel("label"), k = P.get("margin"), N = t.getModel("emphasis");
if (g === "add") {
var R = p[y] = new at();
L = new RM({
shape: {
points: S,
stackedOnPoints: x,
smooth: 0.4,
stackedOnSmooth: 0.4,
smoothConstraint: !1
},
z2: 0
}), R.add(L), s.add(R), t.isAnimationEnabled() && L.setClipPath(f6(L.getBoundingRect(), t, function() {
L.removeClipPath();
}));
} else {
var R = _[m];
L = R.childAt(0), s.add(R), p[y] = R, Ct(L, {
shape: {
points: S,
stackedOnPoints: x
}
}, t), Or(L);
}
xe(L, ve(t), {
labelDataIndex: w[T - 1],
defaultText: i.getName(w[T - 1]),
inheritColor: b.fill
}, {
normal: {
verticalAlign: "middle"
// align: 'right'
}
}), L.setTextConfig({
position: null,
local: !0
});
var V = L.getTextContent();
V && (V.x = E.x - k, V.y = E.y0 + E.y / 2), L.useStyle(b), i.setItemGraphicEl(y, L), Se(L, t), Xt(L, N.get("focus"), N.get("blurScope"), N.get("disabled"));
}
this._layersSeries = l, this._layers = p;
}, e.type = "themeRiver", e;
}(kt)
);
function f6(r, e, t) {
var n = new xt({
shape: {
x: r.x - 10,
y: r.y - 10,
width: 0,
height: r.height + 20
}
});
return $t(n, {
shape: {
x: r.x - 50,
width: r.width + 100,
height: r.height + 20
}
}, e, t), n;
}
var xp = 2, c6 = (
/** @class */
function(r) {
O(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t.type = e.type, t;
}
return e.prototype.init = function(t) {
r.prototype.init.apply(this, arguments), this.legendVisualProvider = new jl(Y(this.getData, this), Y(this.getRawData, this));
}, e.prototype.fixData = function(t) {
var n = t.length, a = {}, i = Sd(t, function(c) {
return a.hasOwnProperty(c[0] + "") || (a[c[0] + ""] = -1), c[2];
}), o = [];
i.buckets.each(function(c, v) {
o.push({
name: v,
dataList: c
});
});
for (var s = o.length, l = 0; l < s; ++l) {
for (var u = o[l].name, h = 0; h < o[l].dataList.length; ++h) {
var f = o[l].dataList[h][0] + "";
a[f] = l;
}
for (var f in a)
a.hasOwnProperty(f) && a[f] !== l && (a[f] = l, t[n] = [f, 0, u], n++);
}
return t;
}, e.prototype.getInitialData = function(t, n) {
for (var a = this.getReferringComponents("singleAxis", ne).models[0], i = a.get("type"), o = At(t.data, function(p) {
return p[2] !== void 0;
}), s = this.fixData(o || []), l = [], u = this.nameMap = X(), h = 0, f = 0; f < s.length; ++f)
l.push(s[f][xp]), u.get(s[f][xp]) || (u.set(s[f][xp], h), h++);
var c = $l(s, {
coordDimensions: ["single"],
dimensionsDefine: [{
name: "time",
type: tf(i)
}, {
name: "value",
type: "float"
}, {
name: "name",
type: "ordinal"
}],
encodeDefine: {
single: 0,
value: 1,
itemName: 2
}
}).dimensions, v = new Ne(c, this);
return v.initData(s), v;
}, e.prototype.getLayerSeries = function() {
for (var t = this.getData(), n = t.count(), a = [], i = 0; i < n; ++i)
a[i] = i;
var o = t.mapDimension("single"), s = Sd(a, function(u) {
return t.get("name", u);
}), l = [];
return s.buckets.each(function(u, h) {
u.sort(function(f, c) {
return t.get(o, f) - t.get(o, c);
}), l.push({
name: h,
indices: u
});
}), l;
}, e.prototype.getAxisTooltipData = function(t, n, a) {
z(t) || (t = t ? [t] : []);
for (var i = this.getData(), o = this.getLayerSeries(), s = [], l = o.length, u, h = 0; h < l; ++h) {
for (var f = Number.MAX_VALUE, c = -1, v = o[h].indices.length, p = 0; p < v; ++p) {
var d = i.get(t[0], o[h].indices[p]), g = Math.abs(d - n);
g <= f && (u = d, f = g, c = o[h].indices[p]);
}
s.push(c);
}
return {
dataIndices: s,
nestestValue: u
};
}, e.prototype.formatTooltip = function(t, n, a) {
var i = this.getData(), o = i.getName(t), s = i.get(i.mapDimension("value"), t);
return pe("nameValue", {
name: o,
value: s
});
}, e.type = "series.themeRiver", e.dependencies = ["singleAxis"], e.defaultOption = {
// zlevel: 0,
z: 2,
colorBy: "data",
coordinateSystem: "singleAxis",
// gap in axis's orthogonal orientation
boundaryGap: ["10%", "10%"],
// legendHoverLink: true,
singleAxisIndex: 0,
animationEasing: "linear",
label: {
margin: 4,
show: !0,
position: "left",
fontSize: 11
},
emphasis: {
label: {
show: !0
}
}
}, e;
}(Ft)
);
function v6(r, e) {
r.eachSeriesByType("themeRiver", function(t) {
var n = t.getData(), a = t.coordinateSystem, i = {}, o = a.getRect();
i.rect = o;
var s = t.get("boundaryGap"), l = a.getAxis();
if (i.boundaryGap = s, l.orient === "horizontal") {
s[0] = W(s[0], o.height), s[1] = W(s[1], o.height);
var u = o.height - s[0] - s[1];
cb(n, t, u);
} else {
s[0] = W(s[0], o.width), s[1] = W(s[1], o.width);
var h = o.width - s[0] - s[1];
cb(n, t, h);
}
n.setLayout("layoutInfo", i);
});
}
function cb(r, e, t) {
if (r.count())
for (var n = e.coordinateSystem, a = e.getLayerSeries(), i = r.mapDimension("single"), o = r.mapDimension("value"), s = G(a, function(g) {
return G(g.indices, function(y) {
var m = n.dataToPoint(r.get(i, y));
return m[1] = r.get(o, y), m;
});
}), l = p6(s), u = l.y0, h = t / l.max, f = a.length, c = a[0].indices.length, v, p = 0; p < c; ++p) {
v = u[p] * h, r.setItemLayout(a[0].indices[p], {
layerIndex: 0,
x: s[0][p][0],
y0: v,
y: s[0][p][1] * h
});
for (var d = 1; d < f; ++d)
v += s[d - 1][p][1] * h, r.setItemLayout(a[d].indices[p], {
layerIndex: d,
x: s[d][p][0],
y0: v,
y: s[d][p][1] * h
});
}
}
function p6(r) {
for (var e = r.length, t = r[0].length, n = [], a = [], i = 0, o = 0; o < t; ++o) {
for (var s = 0, l = 0; l < e; ++l)
s += r[l][o][1];
s > i && (i = s), n.push(s);
}
for (var u = 0; u < t; ++u)
a[u] = (i - n[u]) / 2;
i = 0;
for (var h = 0; h < t; ++h) {
var f = n[h] + a[h];
f > i && (i = f);
}
return {
y0: a,
max: i
};
}
function d6(r) {
r.registerChartView(h6), r.registerSeriesModel(c6), r.registerLayout(v6), r.registerProcessor(Kl("themeRiver"));
}
var g6 = 2, y6 = 4, vb = (
/** @class */
function(r) {
O(e, r);
function e(t, n, a, i) {
var o = r.call(this) || this;
o.z2 = g6, o.textConfig = {
inside: !0
}, it(o).seriesIndex = n.seriesIndex;
var s = new wt({
z2: y6,
silent: t.getModel().get(["label", "silent"])
});
return o.setTextContent(s), o.updateData(!0, t, n, a, i), o;
}
return e.prototype.updateData = function(t, n, a, i, o) {
this.node = n, n.piece = this, a = a || this._seriesModel, i = i || this._ecModel;
var s = this;
it(s).dataIndex = n.dataIndex;
var l = n.getModel(), u = l.getModel("emphasis"), h = n.getLayout(), f = B({}, h);
f.label = null;
var c = n.getVisual("style");
c.lineJoin = "bevel";
var v = n.getVisual("decal");
v && (c.decal = Mo(v, o));
var p = li(l.getModel("itemStyle"), f, !0);
B(f, p), A(ze, function(m) {
var _ = s.ensureState(m), S = l.getModel([m, "itemStyle"]);
_.style = S.getItemStyle();
var x = li(S, f);
x && (_.shape = x);
}), t ? (s.setShape(f), s.shape.r = h.r0, $t(s, {
shape: {
r: h.r
}
}, a, n.dataIndex)) : (Ct(s, {
shape: f
}, a), Or(s)), s.useStyle(c), this._updateLabel(a);
var d = l.getShallow("cursor");
d && s.attr("cursor", d), this._seriesModel = a || this._seriesModel, this._ecModel = i || this._ecModel;
var g = u.get("focus"), y = g === "relative" ? ol(n.getAncestorsIndices(), n.getDescendantIndices()) : g === "ancestor" ? n.getAncestorsIndices() : g === "descendant" ? n.getDescendantIndices() : g;
Xt(this, y, u.get("blurScope"), u.get("disabled"));
}, e.prototype._updateLabel = function(t) {
var n = this, a = this.node.getModel(), i = a.getModel("label"), o = this.node.getLayout(), s = o.endAngle - o.startAngle, l = (o.startAngle + o.endAngle) / 2, u = Math.cos(l), h = Math.sin(l), f = this, c = f.getTextContent(), v = this.node.dataIndex, p = i.get("minAngle") / 180 * Math.PI, d = i.get("show") && !(p != null && Math.abs(s) < p);
c.ignore = !d, A(fl, function(y) {
var m = y === "normal" ? a.getModel("label") : a.getModel([y, "label"]), _ = y === "normal", S = _ ? c : c.ensureState(y), x = t.getFormattedLabel(v, y);
_ && (x = x || n.node.name), S.style = Gt(m, {}, null, y !== "normal", !0), x && (S.style.text = x);
var b = m.get("show");
b != null && !_ && (S.ignore = !b);
var w = g(m, "position"), T = _ ? f : f.states[y], C = T.style.fill;
T.textConfig = {
outsideFill: m.get("color") === "inherit" ? C : null,
inside: w !== "outside"
};
var D, M = g(m, "distance") || 0, I = g(m, "align"), L = g(m, "rotate"), E = Math.PI * 0.5, P = Math.PI * 1.5, k = Je(L === "tangential" ? Math.PI / 2 - l : l), N = k > E && !hl(k - E) && k < P;
w === "outside" ? (D = o.r + M, I = N ? "right" : "left") : !I || I === "center" ? (s === 2 * Math.PI && o.r0 === 0 ? D = 0 : D = (o.r + o.r0) / 2, I = "center") : I === "left" ? (D = o.r0 + M, I = N ? "right" : "left") : I === "right" && (D = o.r - M, I = N ? "left" : "right"), S.style.align = I, S.style.verticalAlign = g(m, "verticalAlign") || "middle", S.x = D * u + o.cx, S.y = D * h + o.cy;
var R = 0;
L === "radial" ? R = Je(-l) + (N ? Math.PI : 0) : L === "tangential" ? R = Je(Math.PI / 2 - l) + (N ? Math.PI : 0) : Tt(L) && (R = L * Math.PI / 180), S.rotation = Je(R);
});
function g(y, m) {
var _ = y.get(m);
return _ ?? i.get(m);
}
c.dirtyStyle();
}, e;
}(Ge)
), xg = "sunburstRootToNode", pb = "sunburstHighlight", m6 = "sunburstUnhighlight";
function _6(r) {
r.registerAction({
type: xg,
update: "updateView"
}, function(e, t) {
t.eachComponent({
mainType: "series",
subType: "sunburst",
query: e
}, n);
function n(a, i) {
var o = Tl(e, [xg], a);
if (o) {
var s = a.getViewRoot();
s && (e.direction = vm(s, o.node) ? "rollUp" : "drillDown"), a.resetViewRoot(o.node);
}
}
}), r.registerAction({
type: pb,
update: "none"
}, function(e, t, n) {
e = B({}, e), t.eachComponent({
mainType: "series",
subType: "sunburst",
query: e
}, a);
function a(i) {
var o = Tl(e, [pb], i);
o && (e.dataIndex = o.node.dataIndex);
}
process.env.NODE_ENV !== "production" && ee("sunburstHighlight", "highlight"), n.dispatchAction(B(e, {
type: "highlight"
}));
}), r.registerAction({
type: m6,
update: "updateView"
}, function(e, t, n) {
e = B({}, e), process.env.NODE_ENV !== "production" && ee("sunburstUnhighlight", "downplay"), n.dispatchAction(B(e, {
type: "downplay"
}));
});
}
var S6 = (
/** @class */
function(r) {
O(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t.type = e.type, t;
}
return e.prototype.render = function(t, n, a, i) {
var o = this;
this.seriesModel = t, this.api = a, this.ecModel = n;
var s = t.getData(), l = s.tree.root, u = t.getViewRoot(), h = this.group, f = t.get("renderLabelForZeroData"), c = [];
u.eachNode(function(m) {
c.push(m);
});
var v = this._oldChildren || [];
p(c, v), y(l, u), this._initEvents(), this._oldChildren = c;
function p(m, _) {
if (m.length === 0 && _.length === 0)
return;
new Ln(_, m, S, S).add(x).update(x).remove(ut(x, null)).execute();
function S(b) {
return b.getId();
}
function x(b, w) {
var T = b == null ? null : m[b], C = w == null ? null : _[w];
d(T, C);
}
}
function d(m, _) {
if (!f && m && !m.getValue() && (m = null), m !== l && _ !== l) {
if (_ && _.piece)
m ? (_.piece.updateData(!1, m, t, n, a), s.setItemGraphicEl(m.dataIndex, _.piece)) : g(_);
else if (m) {
var S = new vb(m, t, n, a);
h.add(S), s.setItemGraphicEl(m.dataIndex, S);
}
}
}
function g(m) {
m && m.piece && (h.remove(m.piece), m.piece = null);
}
function y(m, _) {
_.depth > 0 ? (o.virtualPiece ? o.virtualPiece.updateData(!1, m, t, n, a) : (o.virtualPiece = new vb(m, t, n, a), h.add(o.virtualPiece)), _.piece.off("click"), o.virtualPiece.on("click", function(S) {
o._rootToNode(_.parentNode);
})) : o.virtualPiece && (h.remove(o.virtualPiece), o.virtualPiece = null);
}
}, e.prototype._initEvents = function() {
var t = this;
this.group.off("click"), this.group.on("click", function(n) {
var a = !1, i = t.seriesModel.getViewRoot();
i.eachNode(function(o) {
if (!a && o.piece && o.piece === n.target) {
var s = o.getModel().get("nodeClick");
if (s === "rootToNode")
t._rootToNode(o);
else if (s === "link") {
var l = o.getModel(), u = l.get("link");
if (u) {
var h = l.get("target", !0) || "_blank";
$h(u, h);
}
}
a = !0;
}
});
});
}, e.prototype._rootToNode = function(t) {
t !== this.seriesModel.getViewRoot() && this.api.dispatchAction({
type: xg,
from: this.uid,
seriesId: this.seriesModel.id,
targetNode: t
});
}, e.prototype.containPoint = function(t, n) {
var a = n.getData(), i = a.getItemLayout(0);
if (i) {
var o = t[0] - i.cx, s = t[1] - i.cy, l = Math.sqrt(o * o + s * s);
return l <= i.r && l >= i.r0;
}
}, e.type = "sunburst", e;
}(kt)
), x6 = (
/** @class */
function(r) {
O(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t.type = e.type, t.ignoreStyleOnData = !0, t;
}
return e.prototype.getInitialData = function(t, n) {
var a = {
name: t.name,
children: t.data
};
uI(a);
var i = this._levelModels = G(t.levels || [], function(l) {
return new It(l, this, n);
}, this), o = cm.createTree(a, this, s);
function s(l) {
l.wrapMethod("getItemModel", function(u, h) {
var f = o.getNodeByDataIndex(h), c = i[f.depth];
return c && (u.parentModel = c), u;
});
}
return o.data;
}, e.prototype.optionUpdated = function() {
this.resetViewRoot();
}, e.prototype.getDataParams = function(t) {
var n = r.prototype.getDataParams.apply(this, arguments), a = this.getData().tree.getNodeByDataIndex(t);
return n.treePathInfo = pc(a, this), n;
}, e.prototype.getLevelModel = function(t) {
return this._levelModels && this._levelModels[t.depth];
}, e.prototype.getViewRoot = function() {
return this._viewRoot;
}, e.prototype.resetViewRoot = function(t) {
t ? this._viewRoot = t : t = this._viewRoot;
var n = this.getRawData().tree.root;
(!t || t !== n && !n.contains(t)) && (this._viewRoot = n);
}, e.prototype.enableAriaDecal = function() {
p2(this);
}, e.type = "series.sunburst", e.defaultOption = {
// zlevel: 0,
z: 2,
// 默认全局居中
center: ["50%", "50%"],
radius: [0, "75%"],
// 默认顺时针
clockwise: !0,
startAngle: 90,
// 最小角度改为0
minAngle: 0,
// If still show when all data zero.
stillShowZeroSum: !0,
// 'rootToNode', 'link', or false
nodeClick: "rootToNode",
renderLabelForZeroData: !1,
label: {
// could be: 'radial', 'tangential', or 'none'
rotate: "radial",
show: !0,
opacity: 1,
// 'left' is for inner side of inside, and 'right' is for outer
// side for inside
align: "center",
position: "inside",
distance: 5,
silent: !0
},
itemStyle: {
borderWidth: 1,
borderColor: "white",
borderType: "solid",
shadowBlur: 0,
shadowColor: "rgba(0, 0, 0, 0.2)",
shadowOffsetX: 0,
shadowOffsetY: 0,
opacity: 1
},
emphasis: {
focus: "descendant"
},
blur: {
itemStyle: {
opacity: 0.2
},
label: {
opacity: 0.1
}
},
// Animation type can be expansion, scale.
animationType: "expansion",
animationDuration: 1e3,
animationDurationUpdate: 500,
data: [],
/**
* Sort order.
*
* Valid values: 'desc', 'asc', null, or callback function.
* 'desc' and 'asc' for descend and ascendant order;
* null for not sorting;
* example of callback function:
* function(nodeA, nodeB) {
* return nodeA.getValue() - nodeB.getValue();
* }
*/
sort: "desc"
}, e;
}(Ft)
);
function uI(r) {
var e = 0;
A(r.children, function(n) {
uI(n);
var a = n.value;
z(a) && (a = a[0]), e += a;
});
var t = r.value;
z(t) && (t = t[0]), (t == null || isNaN(t)) && (t = e), t < 0 && (t = 0), z(r.value) ? r.value[0] = t : r.value = t;
}
var db = Math.PI / 180;
function b6(r, e, t) {
e.eachSeriesByType(r, function(n) {
var a = n.get("center"), i = n.get("radius");
z(i) || (i = [0, i]), z(a) || (a = [a, a]);
var o = t.getWidth(), s = t.getHeight(), l = Math.min(o, s), u = W(a[0], o), h = W(a[1], s), f = W(i[0], l / 2), c = W(i[1], l / 2), v = -n.get("startAngle") * db, p = n.get("minAngle") * db, d = n.getData().tree.root, g = n.getViewRoot(), y = g.depth, m = n.get("sort");
m != null && hI(g, m);
var _ = 0;
A(g.children, function(k) {
!isNaN(k.getValue()) && _++;
});
var S = g.getValue(), x = Math.PI / (S || _) * 2, b = g.depth > 0, w = g.height - (b ? -1 : 1), T = (c - f) / (w || 1), C = n.get("clockwise"), D = n.get("stillShowZeroSum"), M = C ? 1 : -1, I = function(k, N) {
if (k) {
var R = N;
if (k !== d) {
var V = k.getValue(), F = S === 0 && D ? x : V * x;
F < p && (F = p), R = N + M * F;
var H = k.depth - y - (b ? -1 : 1), $ = f + T * H, j = f + T * (H + 1), Q = n.getLevelModel(k);
if (Q) {
var st = Q.get("r0", !0), Et = Q.get("r", !0), qt = Q.get("radius", !0);
qt != null && (st = qt[0], Et = qt[1]), st != null && ($ = W(st, l / 2)), Et != null && (j = W(Et, l / 2));
}
k.setLayout({
angle: F,
startAngle: N,
endAngle: R,
clockwise: C,
cx: u,
cy: h,
r0: $,
r: j
});
}
if (k.children && k.children.length) {
var vt = 0;
A(k.children, function(rt) {
vt += I(rt, N + vt);
});
}
return R - N;
}
};
if (b) {
var L = f, E = f + T, P = Math.PI * 2;
d.setLayout({
angle: P,
startAngle: v,
endAngle: v + P,
clockwise: C,
cx: u,
cy: h,
r0: L,
r: E
});
}
I(g, v);
});
}
function hI(r, e) {
var t = r.children || [];
r.children = w6(t, e), t.length && A(r.children, function(n) {
hI(n, e);
});
}
function w6(r, e) {
if (K(e)) {
var t = G(r, function(a, i) {
var o = a.getValue();
return {
params: {
depth: a.depth,
height: a.height,
dataIndex: a.dataIndex,
getValue: function() {
return o;
}
},
index: i
};
});
return t.sort(function(a, i) {
return e(a.params, i.params);
}), G(t, function(a) {
return r[a.index];
});
} else {
var n = e === "asc";
return r.sort(function(a, i) {
var o = (a.getValue() - i.getValue()) * (n ? 1 : -1);
return o === 0 ? (a.dataIndex - i.dataIndex) * (n ? -1 : 1) : o;
});
}
}
function T6(r) {
var e = {};
function t(n, a, i) {
for (var o = n; o && o.depth > 1; )
o = o.parentNode;
var s = a.getColorFromPalette(o.name || o.dataIndex + "", e);
return n.depth > 1 && U(s) && (s = sd(s, (n.depth - 1) / (i - 1) * 0.5)), s;
}
r.eachSeriesByType("sunburst", function(n) {
var a = n.getData(), i = a.tree;
i.eachNode(function(o) {
var s = o.getModel(), l = s.getModel("itemStyle").getItemStyle();
l.fill || (l.fill = t(o, n, i.root.height));
var u = a.ensureUniqueItemVisual(o.dataIndex, "style");
B(u, l);
});
});
}
function C6(r) {
r.registerChartView(S6), r.registerSeriesModel(x6), r.registerLayout(ut(b6, "sunburst")), r.registerProcessor(ut(Kl, "sunburst")), r.registerVisual(T6), _6(r);
}
var gb = {
color: "fill",
borderColor: "stroke"
}, D6 = {
symbol: 1,
symbolSize: 1,
symbolKeepAspect: 1,
legendIcon: 1,
visualMeta: 1,
liftZ: 1,
decal: 1
}, Tn = bt(), A6 = (
/** @class */
function(r) {
O(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t.type = e.type, t;
}
return e.prototype.optionUpdated = function() {
this.currentZLevel = this.get("zlevel", !0), this.currentZ = this.get("z", !0);
}, e.prototype.getInitialData = function(t, n) {
return On(null, this);
}, e.prototype.getDataParams = function(t, n, a) {
var i = r.prototype.getDataParams.call(this, t, n);
return a && (i.info = Tn(a).info), i;
}, e.type = "series.custom", e.dependencies = ["grid", "polar", "geo", "singleAxis", "calendar"], e.defaultOption = {
coordinateSystem: "cartesian2d",
// zlevel: 0,
z: 2,
legendHoverLink: !0,
// Custom series will not clip by default.
// Some case will use custom series to draw label
// For example https://echarts.apache.org/examples/en/editor.html?c=custom-gantt-flight
clip: !1
// Cartesian coordinate system
// xAxisIndex: 0,
// yAxisIndex: 0,
// Polar coordinate system
// polarIndex: 0,
// Geo coordinate system
// geoIndex: 0,
}, e;
}(Ft)
);
function M6(r, e) {
return e = e || [0, 0], G(["x", "y"], function(t, n) {
var a = this.getAxis(t), i = e[n], o = r[n] / 2;
return a.type === "category" ? a.getBandWidth() : Math.abs(a.dataToCoord(i - o) - a.dataToCoord(i + o));
}, this);
}
function I6(r) {
var e = r.master.getRect();
return {
coordSys: {
// The name exposed to user is always 'cartesian2d' but not 'grid'.
type: "cartesian2d",
x: e.x,
y: e.y,
width: e.width,
height: e.height
},
api: {
coord: function(t) {
return r.dataToPoint(t);
},
size: Y(M6, r)
}
};
}
function L6(r, e) {
return e = e || [0, 0], G([0, 1], function(t) {
var n = e[t], a = r[t] / 2, i = [], o = [];
return i[t] = n - a, o[t] = n + a, i[1 - t] = o[1 - t] = e[1 - t], Math.abs(this.dataToPoint(i)[t] - this.dataToPoint(o)[t]);
}, this);
}
function E6(r) {
var e = r.getBoundingRect();
return {
coordSys: {
type: "geo",
x: e.x,
y: e.y,
width: e.width,
height: e.height,
zoom: r.getZoom()
},
api: {
coord: function(t) {
return r.dataToPoint(t);
},
size: Y(L6, r)
}
};
}
function P6(r, e) {
var t = this.getAxis(), n = e instanceof Array ? e[0] : e, a = (r instanceof Array ? r[0] : r) / 2;
return t.type === "category" ? t.getBandWidth() : Math.abs(t.dataToCoord(n - a) - t.dataToCoord(n + a));
}
function k6(r) {
var e = r.getRect();
return {
coordSys: {
type: "singleAxis",
x: e.x,
y: e.y,
width: e.width,
height: e.height
},
api: {
coord: function(t) {
return r.dataToPoint(t);
},
size: Y(P6, r)
}
};
}
function R6(r, e) {
return e = e || [0, 0], G(["Radius", "Angle"], function(t, n) {
var a = "get" + t + "Axis", i = this[a](), o = e[n], s = r[n] / 2, l = i.type === "category" ? i.getBandWidth() : Math.abs(i.dataToCoord(o - s) - i.dataToCoord(o + s));
return t === "Angle" && (l = l * Math.PI / 180), l;
}, this);
}
function N6(r) {
var e = r.getRadiusAxis(), t = r.getAngleAxis(), n = e.getExtent();
return n[0] > n[1] && n.reverse(), {
coordSys: {
type: "polar",
cx: r.cx,
cy: r.cy,
r: n[1],
r0: n[0]
},
api: {
coord: function(a) {
var i = e.dataToRadius(a[0]), o = t.dataToAngle(a[1]), s = r.coordToPoint([i, o]);
return s.push(i, o * Math.PI / 180), s;
},
size: Y(R6, r)
}
};
}
function O6(r) {
var e = r.getRect(), t = r.getRangeInfo();
return {
coordSys: {
type: "calendar",
x: e.x,
y: e.y,
width: e.width,
height: e.height,
cellWidth: r.getCellWidth(),
cellHeight: r.getCellHeight(),
rangeInfo: {
start: t.start,
end: t.end,
weeks: t.weeks,
dayCount: t.allDay
}
},
api: {
coord: function(n, a) {
return r.dataToPoint(n, a);
}
}
};
}
var yb = {};
function fI(r, e, t, n) {
return r && (r.legacy || r.legacy !== !1 && !t && !n && e !== "tspan" && (e === "text" || Z(r, "text")));
}
function cI(r, e, t) {
var n = r, a, i, o;
if (e === "text")
o = n;
else {
o = {}, Z(n, "text") && (o.text = n.text), Z(n, "rich") && (o.rich = n.rich), Z(n, "textFill") && (o.fill = n.textFill), Z(n, "textStroke") && (o.stroke = n.textStroke), Z(n, "fontFamily") && (o.fontFamily = n.fontFamily), Z(n, "fontSize") && (o.fontSize = n.fontSize), Z(n, "fontStyle") && (o.fontStyle = n.fontStyle), Z(n, "fontWeight") && (o.fontWeight = n.fontWeight), i = {
type: "text",
style: o,
// ec4 does not support rectText trigger.
// And when text position is different in normal and emphasis
// => hover text trigger emphasis;
// => text position changed, leave mouse pointer immediately;
// That might cause incorrect state.
silent: !0
}, a = {};
var s = Z(n, "textPosition");
t ? a.position = s ? n.textPosition : "inside" : s && (a.position = n.textPosition), Z(n, "textPosition") && (a.position = n.textPosition), Z(n, "textOffset") && (a.offset = n.textOffset), Z(n, "textRotation") && (a.rotation = n.textRotation), Z(n, "textDistance") && (a.distance = n.textDistance);
}
return mb(o, r), A(o.rich, function(l) {
mb(l, l);
}), {
textConfig: a,
textContent: i
};
}
function mb(r, e) {
e && (e.font = e.textFont || e.font, Z(e, "textStrokeWidth") && (r.lineWidth = e.textStrokeWidth), Z(e, "textAlign") && (r.align = e.textAlign), Z(e, "textVerticalAlign") && (r.verticalAlign = e.textVerticalAlign), Z(e, "textLineHeight") && (r.lineHeight = e.textLineHeight), Z(e, "textWidth") && (r.width = e.textWidth), Z(e, "textHeight") && (r.height = e.textHeight), Z(e, "textBackgroundColor") && (r.backgroundColor = e.textBackgroundColor), Z(e, "textPadding") && (r.padding = e.textPadding), Z(e, "textBorderColor") && (r.borderColor = e.textBorderColor), Z(e, "textBorderWidth") && (r.borderWidth = e.textBorderWidth), Z(e, "textBorderRadius") && (r.borderRadius = e.textBorderRadius), Z(e, "textBoxShadowColor") && (r.shadowColor = e.textBoxShadowColor), Z(e, "textBoxShadowBlur") && (r.shadowBlur = e.textBoxShadowBlur), Z(e, "textBoxShadowOffsetX") && (r.shadowOffsetX = e.textBoxShadowOffsetX), Z(e, "textBoxShadowOffsetY") && (r.shadowOffsetY = e.textBoxShadowOffsetY));
}
function _b(r, e, t) {
var n = r;
n.textPosition = n.textPosition || t.position || "inside", t.offset != null && (n.textOffset = t.offset), t.rotation != null && (n.textRotation = t.rotation), t.distance != null && (n.textDistance = t.distance);
var a = n.textPosition.indexOf("inside") >= 0, i = r.fill || "#000";
Sb(n, e);
var o = n.textFill == null;
return a ? o && (n.textFill = t.insideFill || "#fff", !n.textStroke && t.insideStroke && (n.textStroke = t.insideStroke), !n.textStroke && (n.textStroke = i), n.textStrokeWidth == null && (n.textStrokeWidth = 2)) : (o && (n.textFill = r.fill || t.outsideFill || "#000"), !n.textStroke && t.outsideStroke && (n.textStroke = t.outsideStroke)), n.text = e.text, n.rich = e.rich, A(e.rich, function(s) {
Sb(s, s);
}), n;
}
function Sb(r, e) {
e && (Z(e, "fill") && (r.textFill = e.fill), Z(e, "stroke") && (r.textStroke = e.fill), Z(e, "lineWidth") && (r.textStrokeWidth = e.lineWidth), Z(e, "font") && (r.font = e.font), Z(e, "fontStyle") && (r.fontStyle = e.fontStyle), Z(e, "fontWeight") && (r.fontWeight = e.fontWeight), Z(e, "fontSize") && (r.fontSize = e.fontSize), Z(e, "fontFamily") && (r.fontFamily = e.fontFamily), Z(e, "align") && (r.textAlign = e.align), Z(e, "verticalAlign") && (r.textVerticalAlign = e.verticalAlign), Z(e, "lineHeight") && (r.textLineHeight = e.lineHeight), Z(e, "width") && (r.textWidth = e.width), Z(e, "height") && (r.textHeight = e.height), Z(e, "backgroundColor") && (r.textBackgroundColor = e.backgroundColor), Z(e, "padding") && (r.textPadding = e.padding), Z(e, "borderColor") && (r.textBorderColor = e.borderColor), Z(e, "borderWidth") && (r.textBorderWidth = e.borderWidth), Z(e, "borderRadius") && (r.textBorderRadius = e.borderRadius), Z(e, "shadowColor") && (r.textBoxShadowColor = e.shadowColor), Z(e, "shadowBlur") && (r.textBoxShadowBlur = e.shadowBlur), Z(e, "shadowOffsetX") && (r.textBoxShadowOffsetX = e.shadowOffsetX), Z(e, "shadowOffsetY") && (r.textBoxShadowOffsetY = e.shadowOffsetY), Z(e, "textShadowColor") && (r.textShadowColor = e.textShadowColor), Z(e, "textShadowBlur") && (r.textShadowBlur = e.textShadowBlur), Z(e, "textShadowOffsetX") && (r.textShadowOffsetX = e.textShadowOffsetX), Z(e, "textShadowOffsetY") && (r.textShadowOffsetY = e.textShadowOffsetY));
}
function xb(r, e) {
if (process.env.NODE_ENV !== "production") {
var t = r + "^_^" + e;
yb[t] || (console.warn('[ECharts] DEPRECATED: "' + r + '" has been deprecated. ' + e), yb[t] = !0);
}
}
var vI = {
position: ["x", "y"],
scale: ["scaleX", "scaleY"],
origin: ["originX", "originY"]
}, bb = St(vI), vf = rn(an, function(r, e) {
return r[e] = 1, r;
}, {}), wb = an.join(", "), pf = ["", "style", "shape", "extra"], ko = bt();
function Lm(r, e, t, n, a) {
var i = r + "Animation", o = Go(r, n, a) || {}, s = ko(e).userDuring;
return o.duration > 0 && (o.during = s ? Y(F6, {
el: e,
userDuring: s
}) : null, o.setToFinal = !0, o.scope = r), B(o, t[i]), o;
}
function Sh(r, e, t, n) {
n = n || {};
var a = n.dataIndex, i = n.isInit, o = n.clearStyle, s = t.isAnimationEnabled(), l = ko(r), u = e.style;
l.userDuring = e.during;
var h = {}, f = {};
if (W6(r, e, f), Cb("shape", e, f), Cb("extra", e, f), !i && s && (H6(r, e, h), Tb("shape", r, e, h), Tb("extra", r, e, h), $6(r, e, u, h)), f.style = u, V6(r, f, o), z6(r, e), s)
if (i) {
var c = {};
A(pf, function(p) {
var d = p ? e[p] : e;
d && d.enterFrom && (p && (c[p] = c[p] || {}), B(p ? c[p] : c, d.enterFrom));
});
var v = Lm("enter", r, e, t, a);
v.duration > 0 && r.animateFrom(c, v);
} else
B6(r, e, a || 0, t, h);
pI(r, e), u ? r.dirty() : r.markRedraw();
}
function pI(r, e) {
for (var t = ko(r).leaveToProps, n = 0; n < pf.length; n++) {
var a = pf[n], i = a ? e[a] : e;
i && i.leaveTo && (t || (t = ko(r).leaveToProps = {}), a && (t[a] = t[a] || {}), B(a ? t[a] : t, i.leaveTo));
}
}
function yc(r, e, t, n) {
if (r) {
var a = r.parent, i = ko(r).leaveToProps;
if (i) {
var o = Lm("update", r, e, t, 0);
o.done = function() {
a.remove(r);
}, r.animateTo(i, o);
} else
a.remove(r);
}
}
function yi(r) {
return r === "all";
}
function V6(r, e, t) {
var n = e.style;
if (!r.isGroup && n) {
if (t) {
r.useStyle({});
for (var a = r.animators, i = 0; i < a.length; i++) {
var o = a[i];
o.targetName === "style" && o.changeTarget(r.style);
}
}
r.setStyle(n);
}
e && (e.style = null, e && r.attr(e), e.style = n);
}
function B6(r, e, t, n, a) {
if (a) {
var i = Lm("update", r, e, n, t);
i.duration > 0 && r.animateFrom(a, i);
}
}
function z6(r, e) {
Z(e, "silent") && (r.silent = e.silent), Z(e, "ignore") && (r.ignore = e.ignore), r instanceof Sr && Z(e, "invisible") && (r.invisible = e.invisible), r instanceof mt && Z(e, "autoBatch") && (r.autoBatch = e.autoBatch);
}
var Ur = {}, G6 = {
// Usually other props do not need to be changed in animation during.
setTransform: function(r, e) {
return process.env.NODE_ENV !== "production" && tt(Z(vf, r), "Only " + wb + " available in `setTransform`."), Ur.el[r] = e, this;
},
getTransform: function(r) {
return process.env.NODE_ENV !== "production" && tt(Z(vf, r), "Only " + wb + " available in `getTransform`."), Ur.el[r];
},
setShape: function(r, e) {
process.env.NODE_ENV !== "production" && no(r);
var t = Ur.el, n = t.shape || (t.shape = {});
return n[r] = e, t.dirtyShape && t.dirtyShape(), this;
},
getShape: function(r) {
process.env.NODE_ENV !== "production" && no(r);
var e = Ur.el.shape;
if (e)
return e[r];
},
setStyle: function(r, e) {
process.env.NODE_ENV !== "production" && no(r);
var t = Ur.el, n = t.style;
return n && (process.env.NODE_ENV !== "production" && Si(e) && Zt("style." + r + " must not be assigned with NaN."), n[r] = e, t.dirtyStyle && t.dirtyStyle()), this;
},
getStyle: function(r) {
process.env.NODE_ENV !== "production" && no(r);
var e = Ur.el.style;
if (e)
return e[r];
},
setExtra: function(r, e) {
process.env.NODE_ENV !== "production" && no(r);
var t = Ur.el.extra || (Ur.el.extra = {});
return t[r] = e, this;
},
getExtra: function(r) {
process.env.NODE_ENV !== "production" && no(r);
var e = Ur.el.extra;
if (e)
return e[r];
}
};
function no(r) {
if (process.env.NODE_ENV !== "production" && (r === "transition" || r === "enterFrom" || r === "leaveTo"))
throw new Error('key must not be "' + r + '"');
}
function F6() {
var r = this, e = r.el;
if (e) {
var t = ko(e).userDuring, n = r.userDuring;
if (t !== n) {
r.el = r.userDuring = null;
return;
}
Ur.el = e, n(G6);
}
}
function Tb(r, e, t, n) {
var a = t[r];
if (a) {
var i = e[r], o;
if (i) {
var s = t.transition, l = a.transition;
if (l)
if (!o && (o = n[r] = {}), yi(l))
B(o, i);
else
for (var u = Pt(l), h = 0; h < u.length; h++) {
var f = u[h], c = i[f];
o[f] = c;
}
else if (yi(s) || pt(s, r) >= 0) {
!o && (o = n[r] = {});
for (var v = St(i), h = 0; h < v.length; h++) {
var f = v[h], c = i[f];
U6(a[f], c) && (o[f] = c);
}
}
}
}
}
function Cb(r, e, t) {
var n = e[r];
if (n)
for (var a = t[r] = {}, i = St(n), o = 0; o < i.length; o++) {
var s = i[o];
a[s] = Zs(n[s]);
}
}
function H6(r, e, t) {
for (var n = e.transition, a = yi(n) ? an : Pt(n || []), i = 0; i < a.length; i++) {
var o = a[i];
if (!(o === "style" || o === "shape" || o === "extra")) {
var s = r[o];
process.env.NODE_ENV !== "production" && dI(o, "el.transition"), t[o] = s;
}
}
}
function W6(r, e, t) {
for (var n = 0; n < bb.length; n++) {
var a = bb[n], i = vI[a], o = e[a];
o && (t[i[0]] = o[0], t[i[1]] = o[1]);
}
for (var n = 0; n < an.length; n++) {
var s = an[n];
e[s] != null && (t[s] = e[s]);
}
}
function $6(r, e, t, n) {
if (t) {
var a = r.style, i;
if (a) {
var o = t.transition, s = e.transition;
if (o && !yi(o)) {
var l = Pt(o);
!i && (i = n.style = {});
for (var u = 0; u < l.length; u++) {
var h = l[u], f = a[h];
i[h] = f;
}
} else if (r.getAnimationStyleProps && (yi(s) || yi(o) || pt(s, "style") >= 0)) {
var c = r.getAnimationStyleProps(), v = c ? c.style : null;
if (v) {
!i && (i = n.style = {});
for (var p = St(t), u = 0; u < p.length; u++) {
var h = p[u];
if (v[h]) {
var f = a[h];
i[h] = f;
}
}
}
}
}
}
}
function U6(r, e) {
return De(r) ? r !== e : r != null && isFinite(r);
}
var dI;
process.env.NODE_ENV !== "production" && (dI = function(r, e) {
Z(vf, r) || Zt("Prop `" + r + "` is not a permitted in `" + e + "`. Only `" + St(vf).join("`, `") + "` are permitted.");
});
var gI = bt(), Y6 = ["percent", "easing", "shape", "style", "extra"];
function yI(r) {
r.stopAnimation("keyframe"), r.attr(gI(r));
}
function df(r, e, t) {
if (!(!t.isAnimationEnabled() || !e)) {
if (z(e)) {
A(e, function(s) {
df(r, s, t);
});
return;
}
var n = e.keyframes, a = e.duration;
if (t && a == null) {
var i = Go("enter", t, 0);
a = i && i.duration;
}
if (!(!n || !a)) {
var o = gI(r);
A(pf, function(s) {
if (!(s && !r[s])) {
var l, u = !1;
n.sort(function(h, f) {
return h.percent - f.percent;
}), A(n, function(h) {
var f = r.animators, c = s ? h[s] : h;
if (process.env.NODE_ENV !== "production" && h.percent >= 1 && (u = !0), !!c) {
var v = St(c);
if (s || (v = At(v, function(g) {
return pt(Y6, g) < 0;
})), !!v.length) {
l || (l = r.animate(s, e.loop, !0), l.scope = "keyframe");
for (var p = 0; p < f.length; p++)
f[p] !== l && f[p].targetName === l.targetName && f[p].stopTracks(v);
s && (o[s] = o[s] || {});
var d = s ? o[s] : o;
A(v, function(g) {
d[g] = ((s ? r[s] : r) || {})[g];
}), l.whenWithKeys(a * h.percent, c, v, h.easing);
}
}
}), l && (process.env.NODE_ENV !== "production" && (u || Zt("End frame with percent: 1 is missing in the keyframeAnimation.", !0)), l.delay(e.delay || 0).duration(a).start(e.easing));
}
});
}
}
}
var Cn = "emphasis", aa = "normal", Em = "blur", Pm = "select", ya = [aa, Cn, Em, Pm], bp = {
normal: ["itemStyle"],
emphasis: [Cn, "itemStyle"],
blur: [Em, "itemStyle"],
select: [Pm, "itemStyle"]
}, wp = {
normal: ["label"],
emphasis: [Cn, "label"],
blur: [Em, "label"],
select: [Pm, "label"]
}, Z6 = ["x", "y"], X6 = "e\0\0", sr = {
normal: {},
emphasis: {},
blur: {},
select: {}
}, Db = {
cartesian2d: I6,
geo: E6,
single: k6,
polar: N6,
calendar: O6
};
function gf(r) {
return r instanceof mt;
}
function bg(r) {
return r instanceof Sr;
}
function q6(r, e) {
e.copyTransform(r), bg(e) && bg(r) && (e.setStyle(r.style), e.z = r.z, e.z2 = r.z2, e.zlevel = r.zlevel, e.invisible = r.invisible, e.ignore = r.ignore, gf(e) && gf(r) && e.setShape(r.shape));
}
var K6 = (
/** @class */
function(r) {
O(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t.type = e.type, t;
}
return e.prototype.render = function(t, n, a, i) {
this._progressiveEls = null;
var o = this._data, s = t.getData(), l = this.group, u = Ab(t, s, n, a);
o || l.removeAll(), s.diff(o).add(function(f) {
Tp(a, null, f, u(f, i), t, l, s);
}).remove(function(f) {
var c = o.getItemGraphicEl(f);
c && yc(c, Tn(c).option, t);
}).update(function(f, c) {
var v = o.getItemGraphicEl(c);
Tp(a, v, f, u(f, i), t, l, s);
}).execute();
var h = t.get("clip", !0) ? Xl(t.coordinateSystem, !1, t) : null;
h ? l.setClipPath(h) : l.removeClipPath(), this._data = s;
}, e.prototype.incrementalPrepareRender = function(t, n, a) {
this.group.removeAll(), this._data = null;
}, e.prototype.incrementalRender = function(t, n, a, i, o) {
var s = n.getData(), l = Ab(n, s, a, i), u = this._progressiveEls = [];
function h(v) {
v.isGroup || (v.incremental = !0, v.ensureState("emphasis").hoverLayer = !0);
}
for (var f = t.start; f < t.end; f++) {
var c = Tp(null, null, f, l(f, o), n, this.group, s);
c && (c.traverse(h), u.push(c));
}
}, e.prototype.eachRendered = function(t) {
ma(this._progressiveEls || this.group, t);
}, e.prototype.filterForExposedEvent = function(t, n, a, i) {
var o = n.element;
if (o == null || a.name === o)
return !0;
for (; (a = a.__hostTarget || a.parent) && a !== this.group; )
if (a.name === o)
return !0;
return !1;
}, e.type = "custom", e;
}(kt)
);
function km(r) {
var e = r.type, t;
if (e === "path") {
var n = r.shape, a = n.width != null && n.height != null ? {
x: n.x || 0,
y: n.y || 0,
width: n.width,
height: n.height
} : null, i = SI(n);
t = Zf(i, null, a, n.layout || "center"), Tn(t).customPathData = i;
} else if (e === "image")
t = new ge({}), Tn(t).customImagePath = r.style.image;
else if (e === "text")
t = new wt({});
else if (e === "group")
t = new at();
else {
if (e === "compoundPath")
throw new Error('"compoundPath" is not supported yet.');
var o = xy(e);
if (!o) {
var s = "";
process.env.NODE_ENV !== "production" && (s = 'graphic type "' + e + '" can not be found.'), Dt(s);
}
t = new o();
}
return Tn(t).customGraphicType = e, t.name = r.name, t.z2EmphasisLift = 1, t.z2SelectLift = 1, t;
}
function Rm(r, e, t, n, a, i, o) {
yI(e);
var s = a && a.normal.cfg;
s && e.setTextConfig(s), n && n.transition == null && (n.transition = Z6);
var l = n && n.style;
if (l) {
if (e.type === "text") {
var u = l;
Z(u, "textFill") && (u.fill = u.textFill), Z(u, "textStroke") && (u.stroke = u.textStroke);
}
var h = void 0, f = gf(e) ? l.decal : null;
r && f && (f.dirty = !0, h = Mo(f, r)), l.__decalPattern = h;
}
if (bg(e) && l) {
var h = l.__decalPattern;
h && (l.decal = h);
}
Sh(e, n, i, {
dataIndex: t,
isInit: o,
clearStyle: !0
}), df(e, n.keyframeAnimation, i);
}
function mI(r, e, t, n, a) {
var i = e.isGroup ? null : e, o = a && a[r].cfg;
if (i) {
var s = i.ensureState(r);
if (n === !1) {
var l = i.getState(r);
l && (l.style = null);
} else
s.style = n || null;
o && (s.textConfig = o), Ti(i);
}
}
function j6(r, e, t) {
if (!r.isGroup) {
var n = r, a = t.currentZ, i = t.currentZLevel;
n.z = a, n.zlevel = i;
var o = e.z2;
o != null && (n.z2 = o || 0);
for (var s = 0; s < ya.length; s++)
Q6(n, e, ya[s]);
}
}
function Q6(r, e, t) {
var n = t === aa, a = n ? e : yf(e, t), i = a ? a.z2 : null, o;
i != null && (o = n ? r : r.ensureState(t), o.z2 = i || 0);
}
function Ab(r, e, t, n) {
var a = r.get("renderItem"), i = r.coordinateSystem, o = {};
i && (process.env.NODE_ENV !== "production" && (tt(a, "series.render is required."), tt(i.prepareCustoms || Db[i.type], "This coordSys does not support custom series.")), o = i.prepareCustoms ? i.prepareCustoms(i) : Db[i.type](i));
for (var s = et({
getWidth: n.getWidth,
getHeight: n.getHeight,
getZr: n.getZr,
getDevicePixelRatio: n.getDevicePixelRatio,
value: S,
style: b,
ordinalRawValue: x,
styleEmphasis: w,
visual: D,
barLayout: M,
currentSeriesIndices: I,
font: L
}, o.api || {}), l = {
// The life cycle of context: current round of rendering.
// The global life cycle is probably not necessary, because
// user can store global status by themselves.
context: {},
seriesId: r.id,
seriesName: r.name,
seriesIndex: r.seriesIndex,
coordSys: o.coordSys,
dataInsideLength: e.count(),
encode: J6(r.getData())
}, u, h, f = {}, c = {}, v = {}, p = {}, d = 0; d < ya.length; d++) {
var g = ya[d];
v[g] = r.getModel(bp[g]), p[g] = r.getModel(wp[g]);
}
function y(E) {
return E === u ? h || (h = e.getItemModel(E)) : e.getItemModel(E);
}
function m(E, P) {
return e.hasItemOption ? E === u ? f[P] || (f[P] = y(E).getModel(bp[P])) : y(E).getModel(bp[P]) : v[P];
}
function _(E, P) {
return e.hasItemOption ? E === u ? c[P] || (c[P] = y(E).getModel(wp[P])) : y(E).getModel(wp[P]) : p[P];
}
return function(E, P) {
return u = E, h = null, f = {}, c = {}, a && a(et({
dataIndexInside: E,
dataIndex: e.getRawIndex(E),
// Can be used for optimization when zoom or roam.
actionType: P ? P.type : null
}, l), s);
};
function S(E, P) {
return P == null && (P = u), e.getStore().get(e.getDimensionIndex(E || 0), P);
}
function x(E, P) {
P == null && (P = u), E = E || 0;
var k = e.getDimensionInfo(E);
if (!k) {
var N = e.getDimensionIndex(E);
return N >= 0 ? e.getStore().get(N, P) : void 0;
}
var R = e.get(k.name, P), V = k && k.ordinalMeta;
return V ? V.categories[R] : R;
}
function b(E, P) {
process.env.NODE_ENV !== "production" && xb("api.style", "Please write literal style directly instead."), P == null && (P = u);
var k = e.getItemVisual(P, "style"), N = k && k.fill, R = k && k.opacity, V = m(P, aa).getItemStyle();
N != null && (V.fill = N), R != null && (V.opacity = R);
var F = {
inheritColor: U(N) ? N : "#000"
}, H = _(P, aa), $ = Gt(H, null, F, !1, !0);
$.text = H.getShallow("show") ? ot(r.getFormattedLabel(P, aa), Lo(e, P)) : null;
var j = Hh(H, F, !1);
return C(E, V), V = _b(V, $, j), E && T(V, E), V.legacy = !0, V;
}
function w(E, P) {
process.env.NODE_ENV !== "production" && xb("api.styleEmphasis", "Please write literal style directly instead."), P == null && (P = u);
var k = m(P, Cn).getItemStyle(), N = _(P, Cn), R = Gt(N, null, null, !0, !0);
R.text = N.getShallow("show") ? mr(r.getFormattedLabel(P, Cn), r.getFormattedLabel(P, aa), Lo(e, P)) : null;
var V = Hh(N, null, !0);
return C(E, k), k = _b(k, R, V), E && T(k, E), k.legacy = !0, k;
}
function T(E, P) {
for (var k in P)
Z(P, k) && (E[k] = P[k]);
}
function C(E, P) {
E && (E.textFill && (P.textFill = E.textFill), E.textPosition && (P.textPosition = E.textPosition));
}
function D(E, P) {
if (P == null && (P = u), Z(gb, E)) {
var k = e.getItemVisual(P, "style");
return k ? k[gb[E]] : null;
}
if (Z(D6, E))
return e.getItemVisual(P, E);
}
function M(E) {
if (i.type === "cartesian2d") {
var P = i.getBaseAxis();
return WB(et({
axis: P
}, E));
}
}
function I() {
return t.getCurrentSeriesIndices();
}
function L(E) {
return by(E, t);
}
}
function J6(r) {
var e = {};
return A(r.dimensions, function(t) {
var n = r.getDimensionInfo(t);
if (!n.isExtraCoord) {
var a = n.coordDim, i = e[a] = e[a] || [];
i[n.coordDimIndex] = r.getDimensionIndex(t);
}
}), e;
}
function Tp(r, e, t, n, a, i, o) {
if (!n) {
i.remove(e);
return;
}
var s = Nm(r, e, t, n, a, i);
return s && o.setItemGraphicEl(t, s), s && Xt(s, n.focus, n.blurScope, n.emphasisDisabled), s;
}
function Nm(r, e, t, n, a, i) {
process.env.NODE_ENV !== "production" && tt(n, "should not have an null/undefined element setting");
var o = -1, s = e;
e && _I(e, n, a) && (o = pt(i.childrenRef(), e), e = null);
var l = !e, u = e;
u ? u.clearStates() : (u = km(n), s && q6(s, u)), n.morph === !1 ? u.disableMorphing = !0 : u.disableMorphing && (u.disableMorphing = !1), sr.normal.cfg = sr.normal.conOpt = sr.emphasis.cfg = sr.emphasis.conOpt = sr.blur.cfg = sr.blur.conOpt = sr.select.cfg = sr.select.conOpt = null, sr.isLegacy = !1, e8(u, t, n, a, l, sr), t8(u, t, n, a, l), Rm(r, u, t, n, sr, a, l), Z(n, "info") && (Tn(u).info = n.info);
for (var h = 0; h < ya.length; h++) {
var f = ya[h];
if (f !== aa) {
var c = yf(n, f), v = Om(n, c, f);
mI(f, u, c, v, sr);
}
}
return j6(u, n, a), n.type === "group" && r8(r, u, t, n, a), o >= 0 ? i.replaceAt(u, o) : i.add(u), u;
}
function _I(r, e, t) {
var n = Tn(r), a = e.type, i = e.shape, o = e.style;
return (
// Always create new if universal transition is enabled.
// Because we do transition after render. It needs to know what old element is. Replacement will loose it.
t.isUniversalTransitionEnabled() || a != null && a !== n.customGraphicType || a === "path" && o8(i) && SI(i) !== n.customPathData || a === "image" && Z(o, "image") && o.image !== n.customImagePath
);
}
function t8(r, e, t, n, a) {
var i = t.clipPath;
if (i === !1)
r && r.getClipPath() && r.removeClipPath();
else if (i) {
var o = r.getClipPath();
o && _I(o, i, n) && (o = null), o || (o = km(i), process.env.NODE_ENV !== "production" && tt(gf(o), "Only any type of `path` can be used in `clipPath`, rather than " + o.type + "."), r.setClipPath(o)), Rm(null, o, e, i, null, n, a);
}
}
function e8(r, e, t, n, a, i) {
if (!r.isGroup) {
Mb(t, null, i), Mb(t, Cn, i);
var o = i.normal.conOpt, s = i.emphasis.conOpt, l = i.blur.conOpt, u = i.select.conOpt;
if (o != null || s != null || u != null || l != null) {
var h = r.getTextContent();
if (o === !1)
h && r.removeTextContent();
else {
o = i.normal.conOpt = o || {
type: "text"
}, h ? h.clearStates() : (h = km(o), r.setTextContent(h)), Rm(null, h, e, o, null, n, a);
for (var f = o && o.style, c = 0; c < ya.length; c++) {
var v = ya[c];
if (v !== aa) {
var p = i[v].conOpt;
mI(v, h, p, Om(o, p, v), null);
}
}
f ? h.dirty() : h.markRedraw();
}
}
}
}
function Mb(r, e, t) {
var n = e ? yf(r, e) : r, a = e ? Om(r, n, Cn) : r.style, i = r.type, o = n ? n.textConfig : null, s = r.textContent, l = s ? e ? yf(s, e) : s : null;
if (a && // Because emphasis style has little info to detect legacy,
// if normal is legacy, emphasis is trade as legacy.
(t.isLegacy || fI(a, i, !!o, !!l))) {
t.isLegacy = !0;
var u = cI(a, i, !e);
!o && u.textConfig && (o = u.textConfig), !l && u.textContent && (l = u.textContent);
}
if (!e && l) {
var h = l;
!h.type && (h.type = "text"), process.env.NODE_ENV !== "production" && tt(h.type === "text", 'textContent.type must be "text"');
}
var f = e ? t[e] : t.normal;
f.cfg = o, f.conOpt = l;
}
function yf(r, e) {
return e ? r ? r[e] : null : r;
}
function Om(r, e, t) {
var n = e && e.style;
return n == null && t === Cn && r && (n = r.styleEmphasis), n;
}
function r8(r, e, t, n, a) {
var i = n.children, o = i ? i.length : 0, s = n.$mergeChildren, l = s === "byName" || n.diffChildrenByName, u = s === !1;
if (!(!o && !l && !u)) {
if (l) {
a8({
api: r,
oldChildren: e.children() || [],
newChildren: i || [],
dataIndex: t,
seriesModel: a,
group: e
});
return;
}
u && e.removeAll();
for (var h = 0; h < o; h++) {
var f = i[h], c = e.childAt(h);
f ? (f.ignore == null && (f.ignore = !1), Nm(r, c, t, f, a, e)) : (process.env.NODE_ENV !== "production" && tt(c, "renderItem should not return a group containing elements as null/undefined/{} if they do not exist before."), c.ignore = !0);
}
for (var v = e.childCount() - 1; v >= h; v--) {
var p = e.childAt(v);
n8(e, p, a);
}
}
}
function n8(r, e, t) {
e && yc(e, Tn(r).option, t);
}
function a8(r) {
new Ln(r.oldChildren, r.newChildren, Ib, Ib, r).add(Lb).update(Lb).remove(i8).execute();
}
function Ib(r, e) {
var t = r && r.name;
return t ?? X6 + e;
}
function Lb(r, e) {
var t = this.context, n = r != null ? t.newChildren[r] : null, a = e != null ? t.oldChildren[e] : null;
Nm(t.api, a, t.dataIndex, n, t.seriesModel, t.group);
}
function i8(r) {
var e = this.context, t = e.oldChildren[r];
t && yc(t, Tn(t).option, e.seriesModel);
}
function SI(r) {
return r && (r.pathData || r.d);
}
function o8(r) {
return r && (Z(r, "pathData") || Z(r, "d"));
}
function s8(r) {
r.registerChartView(K6), r.registerSeriesModel(A6);
}
var Ja = bt(), Eb = nt, Cp = Y, Vm = (
/** @class */
function() {
function r() {
this._dragging = !1, this.animationThreshold = 15;
}
return r.prototype.render = function(e, t, n, a) {
var i = t.get("value"), o = t.get("status");
if (this._axisModel = e, this._axisPointerModel = t, this._api = n, !(!a && this._lastValue === i && this._lastStatus === o)) {
this._lastValue = i, this._lastStatus = o;
var s = this._group, l = this._handle;
if (!o || o === "hide") {
s && s.hide(), l && l.hide();
return;
}
s && s.show(), l && l.show();
var u = {};
this.makeElOption(u, i, e, t, n);
var h = u.graphicKey;
h !== this._lastGraphicKey && this.clear(n), this._lastGraphicKey = h;
var f = this._moveAnimation = this.determineAnimation(e, t);
if (!s)
s = this._group = new at(), this.createPointerEl(s, u, e, t), this.createLabelEl(s, u, e, t), n.getZr().add(s);
else {
var c = ut(Pb, t, f);
this.updatePointerEl(s, u, c), this.updateLabelEl(s, u, c, t);
}
Rb(s, t, !0), this._renderHandle(i);
}
}, r.prototype.remove = function(e) {
this.clear(e);
}, r.prototype.dispose = function(e) {
this.clear(e);
}, r.prototype.determineAnimation = function(e, t) {
var n = t.get("animation"), a = e.axis, i = a.type === "category", o = t.get("snap");
if (!o && !i)
return !1;
if (n === "auto" || n == null) {
var s = this.animationThreshold;
if (i && a.getBandWidth() > s)
return !0;
if (o) {
var l = im(e).seriesDataCount, u = a.getExtent();
return Math.abs(u[0] - u[1]) / l > s;
}
return !1;
}
return n === !0;
}, r.prototype.makeElOption = function(e, t, n, a, i) {
}, r.prototype.createPointerEl = function(e, t, n, a) {
var i = t.pointer;
if (i) {
var o = Ja(e).pointerEl = new Pi[i.type](Eb(t.pointer));
e.add(o);
}
}, r.prototype.createLabelEl = function(e, t, n, a) {
if (t.label) {
var i = Ja(e).labelEl = new wt(Eb(t.label));
e.add(i), kb(i, a);
}
}, r.prototype.updatePointerEl = function(e, t, n) {
var a = Ja(e).pointerEl;
a && t.pointer && (a.setStyle(t.pointer.style), n(a, {
shape: t.pointer.shape
}));
}, r.prototype.updateLabelEl = function(e, t, n, a) {
var i = Ja(e).labelEl;
i && (i.setStyle(t.label.style), n(i, {
// Consider text length change in vertical axis, animation should
// be used on shape, otherwise the effect will be weird.
// TODOTODO
// shape: elOption.label.shape,
x: t.label.x,
y: t.label.y
}), kb(i, a));
}, r.prototype._renderHandle = function(e) {
if (!(this._dragging || !this.updateHandleTransform)) {
var t = this._axisPointerModel, n = this._api.getZr(), a = this._handle, i = t.getModel("handle"), o = t.get("status");
if (!i.get("show") || !o || o === "hide") {
a && n.remove(a), this._handle = null;
return;
}
var s;
this._handle || (s = !0, a = this._handle = Hl(i.get("icon"), {
cursor: "move",
draggable: !0,
onmousemove: function(u) {
Dn(u.event);
},
onmousedown: Cp(this._onHandleDragMove, this, 0, 0),
drift: Cp(this._onHandleDragMove, this),
ondragend: Cp(this._onHandleDragEnd, this)
}), n.add(a)), Rb(a, t, !1), a.setStyle(i.getItemStyle(null, ["color", "borderColor", "borderWidth", "opacity", "shadowColor", "shadowBlur", "shadowOffsetX", "shadowOffsetY"]));
var l = i.get("size");
z(l) || (l = [l, l]), a.scaleX = l[0] / 2, a.scaleY = l[1] / 2, Xo(this, "_doDispatchAxisPointer", i.get("throttle") || 0, "fixRate"), this._moveHandleToValue(e, s);
}
}, r.prototype._moveHandleToValue = function(e, t) {
Pb(this._axisPointerModel, !t && this._moveAnimation, this._handle, Dp(this.getHandleTransform(e, this._axisModel, this._axisPointerModel)));
}, r.prototype._onHandleDragMove = function(e, t) {
var n = this._handle;
if (n) {
this._dragging = !0;
var a = this.updateHandleTransform(Dp(n), [e, t], this._axisModel, this._axisPointerModel);
this._payloadInfo = a, n.stopAnimation(), n.attr(Dp(a)), Ja(n).lastProp = null, this._doDispatchAxisPointer();
}
}, r.prototype._doDispatchAxisPointer = function() {
var e = this._handle;
if (e) {
var t = this._payloadInfo, n = this._axisModel;
this._api.dispatchAction({
type: "updateAxisPointer",
x: t.cursorPoint[0],
y: t.cursorPoint[1],
tooltipOption: t.tooltipOption,
axesInfo: [{
axisDim: n.axis.dim,
axisIndex: n.componentIndex
}]
});
}
}, r.prototype._onHandleDragEnd = function() {
this._dragging = !1;
var e = this._handle;
if (e) {
var t = this._axisPointerModel.get("value");
this._moveHandleToValue(t), this._api.dispatchAction({
type: "hideTip"
});
}
}, r.prototype.clear = function(e) {
this._lastValue = null, this._lastStatus = null;
var t = e.getZr(), n = this._group, a = this._handle;
t && n && (this._lastGraphicKey = null, n && t.remove(n), a && t.remove(a), this._group = null, this._handle = null, this._payloadInfo = null), gl(this, "_doDispatchAxisPointer");
}, r.prototype.doClear = function() {
}, r.prototype.buildLabel = function(e, t, n) {
return n = n || 0, {
x: e[n],
y: e[1 - n],
width: t[n],
height: t[1 - n]
};
}, r;
}()
);
function Pb(r, e, t, n) {
xI(Ja(t).lastProp, n) || (Ja(t).lastProp = n, e ? Ct(t, n, r) : (t.stopAnimation(), t.attr(n)));
}
function xI(r, e) {
if (J(r) && J(e)) {
var t = !0;
return A(e, function(n, a) {
t = t && xI(r[a], n);
}), !!t;
} else
return r === e;
}
function kb(r, e) {
r[e.get(["label", "show"]) ? "show" : "hide"]();
}
function Dp(r) {
return {
x: r.x || 0,
y: r.y || 0,
rotation: r.rotation || 0
};
}
function Rb(r, e, t) {
var n = e.get("z"), a = e.get("zlevel");
r && r.traverse(function(i) {
i.type !== "group" && (n != null && (i.z = n), a != null && (i.zlevel = a), i.silent = t);
});
}
function Bm(r) {
var e = r.get("type"), t = r.getModel(e + "Style"), n;
return e === "line" ? (n = t.getLineStyle(), n.fill = null) : e === "shadow" && (n = t.getAreaStyle(), n.stroke = null), n;
}
function bI(r, e, t, n, a) {
var i = t.get("value"), o = wI(i, e.axis, e.ecModel, t.get("seriesDataIndices"), {
precision: t.get(["label", "precision"]),
formatter: t.get(["label", "formatter"])
}), s = t.getModel("label"), l = Wo(s.get("padding") || 0), u = s.getFont(), h = Nl(o, u), f = a.position, c = h.width + l[1] + l[3], v = h.height + l[0] + l[2], p = a.align;
p === "right" && (f[0] -= c), p === "center" && (f[0] -= c / 2);
var d = a.verticalAlign;
d === "bottom" && (f[1] -= v), d === "middle" && (f[1] -= v / 2), l8(f, c, v, n);
var g = s.get("backgroundColor");
(!g || g === "auto") && (g = e.get(["axisLine", "lineStyle", "color"])), r.label = {
// shape: {x: 0, y: 0, width: width, height: height, r: labelModel.get('borderRadius')},
x: f[0],
y: f[1],
style: Gt(s, {
text: o,
font: u,
fill: s.getTextColor(),
padding: l,
backgroundColor: g
}),
// Label should be over axisPointer.
z2: 10
};
}
function l8(r, e, t, n) {
var a = n.getWidth(), i = n.getHeight();
r[0] = Math.min(r[0] + e, a) - e, r[1] = Math.min(r[1] + t, i) - t, r[0] = Math.max(r[0], 0), r[1] = Math.max(r[1], 0);
}
function wI(r, e, t, n, a) {
r = e.scale.parse(r);
var i = e.scale.getLabel({
value: r
}, {
// If `precision` is set, width can be fixed (like '12.00500'), which
// helps to debounce when when moving label.
precision: a.precision
}), o = a.formatter;
if (o) {
var s = {
value: Xy(e, {
value: r
}),
axisDimension: e.dim,
axisIndex: e.index,
seriesData: []
};
A(n, function(l) {
var u = t.getSeriesByIndex(l.seriesIndex), h = l.dataIndexInside, f = u && u.getDataParams(h);
f && s.seriesData.push(f);
}), U(o) ? i = o.replace("{value}", i) : K(o) && (i = o(s));
}
return i;
}
function zm(r, e, t) {
var n = tr();
return Li(n, n, t.rotation), nn(n, n, t.position), kr([r.dataToCoord(e), (t.labelOffset || 0) + (t.labelDirection || 1) * (t.labelMargin || 0)], n);
}
function TI(r, e, t, n, a, i) {
var o = Oe.innerTextLayout(t.rotation, 0, t.labelDirection);
t.labelMargin = a.get(["label", "margin"]), bI(e, n, a, i, {
position: zm(n.axis, r, t),
align: o.textAlign,
verticalAlign: o.textVerticalAlign
});
}
function Gm(r, e, t) {
return t = t || 0, {
x1: r[t],
y1: r[1 - t],
x2: e[t],
y2: e[1 - t]
};
}
function CI(r, e, t) {
return t = t || 0, {
x: r[t],
y: r[1 - t],
width: e[t],
height: e[1 - t]
};
}
function Nb(r, e, t, n, a, i) {
return {
cx: r,
cy: e,
r0: t,
r: n,
startAngle: a,
endAngle: i,
clockwise: !0
};
}
var u8 = (
/** @class */
function(r) {
O(e, r);
function e() {
return r !== null && r.apply(this, arguments) || this;
}
return e.prototype.makeElOption = function(t, n, a, i, o) {
var s = a.axis, l = s.grid, u = i.get("type"), h = Ob(l, s).getOtherAxis(s).getGlobalExtent(), f = s.toGlobalCoord(s.dataToCoord(n, !0));
if (u && u !== "none") {
var c = Bm(i), v = h8[u](s, f, h);
v.style = c, t.graphicKey = v.type, t.pointer = v;
}
var p = ng(l.model, a);
TI(
// @ts-ignore
n,
t,
p,
a,
i,
o
);
}, e.prototype.getHandleTransform = function(t, n, a) {
var i = ng(n.axis.grid.model, n, {
labelInside: !1
});
i.labelMargin = a.get(["handle", "margin"]);
var o = zm(n.axis, t, i);
return {
x: o[0],
y: o[1],
rotation: i.rotation + (i.labelDirection < 0 ? Math.PI : 0)
};
}, e.prototype.updateHandleTransform = function(t, n, a, i) {
var o = a.axis, s = o.grid, l = o.getGlobalExtent(!0), u = Ob(s, o).getOtherAxis(o).getGlobalExtent(), h = o.dim === "x" ? 0 : 1, f = [t.x, t.y];
f[h] += n[h], f[h] = Math.min(l[1], f[h]), f[h] = Math.max(l[0], f[h]);
var c = (u[1] + u[0]) / 2, v = [c, c];
v[h] = f[h];
var p = [{
verticalAlign: "middle"
}, {
align: "center"
}];
return {
x: f[0],
y: f[1],
rotation: t.rotation,
cursorPoint: v,
tooltipOption: p[h]
};
}, e;
}(Vm)
);
function Ob(r, e) {
var t = {};
return t[e.dim + "AxisIndex"] = e.index, r.getCartesian(t);
}
var h8 = {
line: function(r, e, t) {
var n = Gm([e, t[0]], [e, t[1]], Vb(r));
return {
type: "Line",
subPixelOptimize: !0,
shape: n
};
},
shadow: function(r, e, t) {
var n = Math.max(1, r.getBandWidth()), a = t[1] - t[0];
return {
type: "Rect",
shape: CI([e - n / 2, t[0]], [n, a], Vb(r))
};
}
};
function Vb(r) {
return r.dim === "x" ? 0 : 1;
}
var f8 = (
/** @class */
function(r) {
O(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t.type = e.type, t;
}
return e.type = "axisPointer", e.defaultOption = {
// 'auto' means that show when triggered by tooltip or handle.
show: "auto",
// zlevel: 0,
z: 50,
type: "line",
// axispointer triggered by tootip determine snap automatically,
// see `modelHelper`.
snap: !1,
triggerTooltip: !0,
triggerEmphasis: !0,
value: null,
status: null,
link: [],
// Do not set 'auto' here, otherwise global animation: false
// will not effect at this axispointer.
animation: null,
animationDurationUpdate: 200,
lineStyle: {
color: "#B9BEC9",
width: 1,
type: "dashed"
},
shadowStyle: {
color: "rgba(210,219,238,0.2)"
},
label: {
show: !0,
formatter: null,
precision: "auto",
margin: 3,
color: "#fff",
padding: [5, 7, 5, 7],
backgroundColor: "auto",
borderColor: null,
borderWidth: 0,
borderRadius: 3
},
handle: {
show: !1,
// eslint-disable-next-line
icon: "M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4h1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7v-1.2h6.6z M13.3,22H6.7v-1.2h6.6z M13.3,19.6H6.7v-1.2h6.6z",
size: 45,
// handle margin is from symbol center to axis, which is stable when circular move.
margin: 50,
// color: '#1b8bbd'
// color: '#2f4554'
color: "#333",
shadowBlur: 3,
shadowColor: "#aaa",
shadowOffsetX: 0,
shadowOffsetY: 2,
// For mobile performance
throttle: 40
}
}, e;
}(_t)
), _n = bt(), c8 = A;
function DI(r, e, t) {
if (!yt.node) {
var n = e.getZr();
_n(n).records || (_n(n).records = {}), v8(n, e);
var a = _n(n).records[r] || (_n(n).records[r] = {});
a.handler = t;
}
}
function v8(r, e) {
if (_n(r).initialized)
return;
_n(r).initialized = !0, t("click", ut(Bb, "click")), t("mousemove", ut(Bb, "mousemove")), t("globalout", d8);
function t(n, a) {
r.on(n, function(i) {
var o = g8(e);
c8(_n(r).records, function(s) {
s && a(s, i, o.dispatchAction);
}), p8(o.pendings, e);
});
}
}
function p8(r, e) {
var t = r.showTip.length, n = r.hideTip.length, a;
t ? a = r.showTip[t - 1] : n && (a = r.hideTip[n - 1]), a && (a.dispatchAction = null, e.dispatchAction(a));
}
function d8(r, e, t) {
r.handler("leave", null, t);
}
function Bb(r, e, t, n) {
e.handler(r, t, n);
}
function g8(r) {
var e = {
showTip: [],
hideTip: []
}, t = function(n) {
var a = e[n.type];
a ? a.push(n) : (n.dispatchAction = t, r.dispatchAction(n));
};
return {
dispatchAction: t,
pendings: e
};
}
function wg(r, e) {
if (!yt.node) {
var t = e.getZr(), n = (_n(t).records || {})[r];
n && (_n(t).records[r] = null);
}
}
var y8 = (
/** @class */
function(r) {
O(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t.type = e.type, t;
}
return e.prototype.render = function(t, n, a) {
var i = n.getComponent("tooltip"), o = t.get("triggerOn") || i && i.get("triggerOn") || "mousemove|click";
DI("axisPointer", a, function(s, l, u) {
o !== "none" && (s === "leave" || o.indexOf(s) >= 0) && u({
type: "updateAxisPointer",
currTrigger: s,
x: l && l.offsetX,
y: l && l.offsetY
});
});
}, e.prototype.remove = function(t, n) {
wg("axisPointer", n);
}, e.prototype.dispose = function(t, n) {
wg("axisPointer", n);
}, e.type = "axisPointer", e;
}(Yt)
);
function AI(r, e) {
var t = [], n = r.seriesIndex, a;
if (n == null || !(a = e.getSeriesByIndex(n)))
return {
point: []
};
var i = a.getData(), o = bi(i, r);
if (o == null || o < 0 || z(o))
return {
point: []
};
var s = i.getItemGraphicEl(o), l = a.coordinateSystem;
if (a.getTooltipPosition)
t = a.getTooltipPosition(o) || [];
else if (l && l.dataToPoint)
if (r.isStacked) {
var u = l.getBaseAxis(), h = l.getOtherAxis(u), f = h.dim, c = u.dim, v = f === "x" || f === "radius" ? 1 : 0, p = i.mapDimension(c), d = [];
d[v] = i.get(p, o), d[1 - v] = i.get(i.getCalculationInfo("stackResultDimension"), o), t = l.dataToPoint(d) || [];
} else
t = l.dataToPoint(i.getValues(G(l.dimensions, function(y) {
return i.mapDimension(y);
}), o)) || [];
else if (s) {
var g = s.getBoundingRect().clone();
g.applyTransform(s.transform), t = [g.x + g.width / 2, g.y + g.height / 2];
}
return {
point: t,
el: s
};
}
var zb = bt();
function m8(r, e, t) {
var n = r.currTrigger, a = [r.x, r.y], i = r, o = r.dispatchAction || Y(t.dispatchAction, t), s = e.getComponent("axisPointer").coordSysAxesInfo;
if (s) {
xh(a) && (a = AI({
seriesIndex: i.seriesIndex,
// Do not use dataIndexInside from other ec instance.
// FIXME: auto detect it?
dataIndex: i.dataIndex
}, e).point);
var l = xh(a), u = i.axesInfo, h = s.axesInfo, f = n === "leave" || xh(a), c = {}, v = {}, p = {
list: [],
map: {}
}, d = {
showPointer: ut(S8, v),
showTooltip: ut(x8, p)
};
A(s.coordSysMap, function(y, m) {
var _ = l || y.containPoint(a);
A(s.coordSysAxesInfo[m], function(S, x) {
var b = S.axis, w = C8(u, S);
if (!f && _ && (!u || w)) {
var T = w && w.value;
T == null && !l && (T = b.pointToData(a)), T != null && Gb(S, T, d, !1, c);
}
});
});
var g = {};
return A(h, function(y, m) {
var _ = y.linkGroup;
_ && !v[m] && A(_.axesInfo, function(S, x) {
var b = v[x];
if (S !== y && b) {
var w = b.value;
_.mapper && (w = y.axis.scale.parse(_.mapper(w, Fb(S), Fb(y)))), g[y.key] = w;
}
});
}), A(g, function(y, m) {
Gb(h[m], y, d, !0, c);
}), b8(v, h, c), w8(p, a, r, o), T8(h, o, t), c;
}
}
function Gb(r, e, t, n, a) {
var i = r.axis;
if (!(i.scale.isBlank() || !i.containData(e))) {
if (!r.involveSeries) {
t.showPointer(r, e);
return;
}
var o = _8(e, r), s = o.payloadBatch, l = o.snapToValue;
s[0] && a.seriesIndex == null && B(a, s[0]), !n && r.snap && i.containData(l) && l != null && (e = l), t.showPointer(r, e, s), t.showTooltip(r, o, l);
}
}
function _8(r, e) {
var t = e.axis, n = t.dim, a = r, i = [], o = Number.MAX_VALUE, s = -1;
return A(e.seriesModels, function(l, u) {
var h = l.getData().mapDimensionsAll(n), f, c;
if (l.getAxisTooltipData) {
var v = l.getAxisTooltipData(h, r, t);
c = v.dataIndices, f = v.nestestValue;
} else {
if (c = l.getData().indicesOfNearest(
h[0],
r,
// Add a threshold to avoid find the wrong dataIndex
// when data length is not same.
// false,
t.type === "category" ? 0.5 : null
), !c.length)
return;
f = l.getData().get(h[0], c[0]);
}
if (!(f == null || !isFinite(f))) {
var p = r - f, d = Math.abs(p);
d <= o && ((d < o || p >= 0 && s < 0) && (o = d, s = p, a = f, i.length = 0), A(c, function(g) {
i.push({
seriesIndex: l.seriesIndex,
dataIndexInside: g,
dataIndex: l.getData().getRawIndex(g)
});
}));
}
}), {
payloadBatch: i,
snapToValue: a
};
}
function S8(r, e, t, n) {
r[e.key] = {
value: t,
payloadBatch: n
};
}
function x8(r, e, t, n) {
var a = t.payloadBatch, i = e.axis, o = i.model, s = e.axisPointerModel;
if (!(!e.triggerTooltip || !a.length)) {
var l = e.coordSys.model, u = wl(l), h = r.map[u];
h || (h = r.map[u] = {
coordSysId: l.id,
coordSysIndex: l.componentIndex,
coordSysType: l.type,
coordSysMainType: l.mainType,
dataByAxis: []
}, r.list.push(h)), h.dataByAxis.push({
axisDim: i.dim,
axisIndex: o.componentIndex,
axisType: o.type,
axisId: o.id,
value: n,
// Caustion: viewHelper.getValueLabel is actually on "view stage", which
// depends that all models have been updated. So it should not be performed
// here. Considering axisPointerModel used here is volatile, which is hard
// to be retrieve in TooltipView, we prepare parameters here.
valueLabelOpt: {
precision: s.get(["label", "precision"]),
formatter: s.get(["label", "formatter"])
},
seriesDataIndices: a.slice()
});
}
}
function b8(r, e, t) {
var n = t.axesInfo = [];
A(e, function(a, i) {
var o = a.axisPointerModel.option, s = r[i];
s ? (!a.useHandle && (o.status = "show"), o.value = s.value, o.seriesDataIndices = (s.payloadBatch || []).slice()) : !a.useHandle && (o.status = "hide"), o.status === "show" && n.push({
axisDim: a.axis.dim,
axisIndex: a.axis.model.componentIndex,
value: o.value
});
});
}
function w8(r, e, t, n) {
if (xh(e) || !r.list.length) {
n({
type: "hideTip"
});
return;
}
var a = ((r.list[0].dataByAxis[0] || {}).seriesDataIndices || [])[0] || {};
n({
type: "showTip",
escapeConnect: !0,
x: e[0],
y: e[1],
tooltipOption: t.tooltipOption,
position: t.position,
dataIndexInside: a.dataIndexInside,
dataIndex: a.dataIndex,
seriesIndex: a.seriesIndex,
dataByCoordSys: r.list
});
}
function T8(r, e, t) {
var n = t.getZr(), a = "axisPointerLastHighlights", i = zb(n)[a] || {}, o = zb(n)[a] = {};
A(r, function(u, h) {
var f = u.axisPointerModel.option;
f.status === "show" && u.triggerEmphasis && A(f.seriesDataIndices, function(c) {
var v = c.seriesIndex + " | " + c.dataIndex;
o[v] = c;
});
});
var s = [], l = [];
A(i, function(u, h) {
!o[h] && l.push(u);
}), A(o, function(u, h) {
!i[h] && s.push(u);
}), l.length && t.dispatchAction({
type: "downplay",
escapeConnect: !0,
// Not blur others when highlight in axisPointer.
notBlur: !0,
batch: l
}), s.length && t.dispatchAction({
type: "highlight",
escapeConnect: !0,
// Not blur others when highlight in axisPointer.
notBlur: !0,
batch: s
});
}
function C8(r, e) {
for (var t = 0; t < (r || []).length; t++) {
var n = r[t];
if (e.axis.dim === n.axisDim && e.axis.model.componentIndex === n.axisIndex)
return n;
}
}
function Fb(r) {
var e = r.axis.model, t = {}, n = t.axisDim = r.axis.dim;
return t.axisIndex = t[n + "AxisIndex"] = e.componentIndex, t.axisName = t[n + "AxisName"] = e.name, t.axisId = t[n + "AxisId"] = e.id, t;
}
function xh(r) {
return !r || r[0] == null || isNaN(r[0]) || r[1] == null || isNaN(r[1]);
}
function tu(r) {
Oi.registerAxisPointerClass("CartesianAxisPointer", u8), r.registerComponentModel(f8), r.registerComponentView(y8), r.registerPreprocessor(function(e) {
if (e) {
(!e.axisPointer || e.axisPointer.length === 0) && (e.axisPointer = {});
var t = e.axisPointer.link;
t && !z(t) && (e.axisPointer.link = [t]);
}
}), r.registerProcessor(r.PRIORITY.PROCESSOR.STATISTIC, function(e, t) {
e.getComponent("axisPointer").coordSysAxesInfo = O3(e, t);
}), r.registerAction({
type: "updateAxisPointer",
event: "updateAxisPointer",
update: ":updateAxisPointer"
}, m8);
}
function D8(r) {
gt(t2), gt(tu);
}
var A8 = (
/** @class */
function(r) {
O(e, r);
function e() {
return r !== null && r.apply(this, arguments) || this;
}
return e.prototype.makeElOption = function(t, n, a, i, o) {
var s = a.axis;
s.dim === "angle" && (this.animationThreshold = Math.PI / 18);
var l = s.polar, u = l.getOtherAxis(s), h = u.getExtent(), f = s.dataToCoord(n), c = i.get("type");
if (c && c !== "none") {
var v = Bm(i), p = I8[c](s, l, f, h);
p.style = v, t.graphicKey = p.type, t.pointer = p;
}
var d = i.get(["label", "margin"]), g = M8(n, a, i, l, d);
bI(t, a, i, o, g);
}, e;
}(Vm)
);
function M8(r, e, t, n, a) {
var i = e.axis, o = i.dataToCoord(r), s = n.getAngleAxis().getExtent()[0];
s = s / 180 * Math.PI;
var l = n.getRadiusAxis().getExtent(), u, h, f;
if (i.dim === "radius") {
var c = tr();
Li(c, c, s), nn(c, c, [n.cx, n.cy]), u = kr([o, -a], c);
var v = e.getModel("axisLabel").get("rotate") || 0, p = Oe.innerTextLayout(s, v * Math.PI / 180, -1);
h = p.textAlign, f = p.textVerticalAlign;
} else {
var d = l[1];
u = n.coordToPoint([d + a, o]);
var g = n.cx, y = n.cy;
h = Math.abs(u[0] - g) / d < 0.3 ? "center" : u[0] > g ? "left" : "right", f = Math.abs(u[1] - y) / d < 0.3 ? "middle" : u[1] > y ? "top" : "bottom";
}
return {
position: u,
align: h,
verticalAlign: f
};
}
var I8 = {
line: function(r, e, t, n) {
return r.dim === "angle" ? {
type: "Line",
shape: Gm(e.coordToPoint([n[0], t]), e.coordToPoint([n[1], t]))
} : {
type: "Circle",
shape: {
cx: e.cx,
cy: e.cy,
r: t
}
};
},
shadow: function(r, e, t, n) {
var a = Math.max(1, r.getBandWidth()), i = Math.PI / 180;
return r.dim === "angle" ? {
type: "Sector",
shape: Nb(
e.cx,
e.cy,
n[0],
n[1],
// In ECharts y is negative if angle is positive
(-t - a / 2) * i,
(-t + a / 2) * i
)
} : {
type: "Sector",
shape: Nb(e.cx, e.cy, t - a / 2, t + a / 2, 0, Math.PI * 2)
};
}
}, L8 = (
/** @class */
function(r) {
O(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t.type = e.type, t;
}
return e.prototype.findAxisModel = function(t) {
var n, a = this.ecModel;
return a.eachComponent(t, function(i) {
i.getCoordSysModel() === this && (n = i);
}, this), n;
}, e.type = "polar", e.dependencies = ["radiusAxis", "angleAxis"], e.defaultOption = {
// zlevel: 0,
z: 0,
center: ["50%", "50%"],
radius: "80%"
}, e;
}(_t)
), Fm = (
/** @class */
function(r) {
O(e, r);
function e() {
return r !== null && r.apply(this, arguments) || this;
}
return e.prototype.getCoordSysModel = function() {
return this.getReferringComponents("polar", ne).models[0];
}, e.type = "polarAxis", e;
}(_t)
);
ie(Fm, Ul);
var E8 = (
/** @class */
function(r) {
O(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t.type = e.type, t;
}
return e.type = "angleAxis", e;
}(Fm)
), P8 = (
/** @class */
function(r) {
O(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t.type = e.type, t;
}
return e.type = "radiusAxis", e;
}(Fm)
), Hm = (
/** @class */
function(r) {
O(e, r);
function e(t, n) {
return r.call(this, "radius", t, n) || this;
}
return e.prototype.pointToData = function(t, n) {
return this.polar.pointToData(t, n)[this.dim === "radius" ? 0 : 1];
}, e;
}(Br)
);
Hm.prototype.dataToRadius = Br.prototype.dataToCoord;
Hm.prototype.radiusToData = Br.prototype.coordToData;
var k8 = bt(), Wm = (
/** @class */
function(r) {
O(e, r);
function e(t, n) {
return r.call(this, "angle", t, n || [0, 360]) || this;
}
return e.prototype.pointToData = function(t, n) {
return this.polar.pointToData(t, n)[this.dim === "radius" ? 0 : 1];
}, e.prototype.calculateCategoryInterval = function() {
var t = this, n = t.getLabelModel(), a = t.scale, i = a.getExtent(), o = a.count();
if (i[1] - i[0] < 1)
return 0;
var s = i[0], l = t.dataToCoord(s + 1) - t.dataToCoord(s), u = Math.abs(l), h = Nl(s == null ? "" : s + "", n.getFont(), "center", "top"), f = Math.max(h.height, 7), c = f / u;
isNaN(c) && (c = 1 / 0);
var v = Math.max(0, Math.floor(c)), p = k8(t.model), d = p.lastAutoInterval, g = p.lastTickCount;
return d != null && g != null && Math.abs(d - v) <= 1 && Math.abs(g - o) <= 1 && d > v ? v = d : (p.lastTickCount = o, p.lastAutoInterval = v), v;
}, e;
}(Br)
);
Wm.prototype.dataToAngle = Br.prototype.dataToCoord;
Wm.prototype.angleToData = Br.prototype.coordToData;
var MI = ["radius", "angle"], R8 = (
/** @class */
function() {
function r(e) {
this.dimensions = MI, this.type = "polar", this.cx = 0, this.cy = 0, this._radiusAxis = new Hm(), this._angleAxis = new Wm(), this.axisPointerEnabled = !0, this.name = e || "", this._radiusAxis.polar = this._angleAxis.polar = this;
}
return r.prototype.containPoint = function(e) {
var t = this.pointToCoord(e);
return this._radiusAxis.contain(t[0]) && this._angleAxis.contain(t[1]);
}, r.prototype.containData = function(e) {
return this._radiusAxis.containData(e[0]) && this._angleAxis.containData(e[1]);
}, r.prototype.getAxis = function(e) {
var t = "_" + e + "Axis";
return this[t];
}, r.prototype.getAxes = function() {
return [this._radiusAxis, this._angleAxis];
}, r.prototype.getAxesByScale = function(e) {
var t = [], n = this._angleAxis, a = this._radiusAxis;
return n.scale.type === e && t.push(n), a.scale.type === e && t.push(a), t;
}, r.prototype.getAngleAxis = function() {
return this._angleAxis;
}, r.prototype.getRadiusAxis = function() {
return this._radiusAxis;
}, r.prototype.getOtherAxis = function(e) {
var t = this._angleAxis;
return e === t ? this._radiusAxis : t;
}, r.prototype.getBaseAxis = function() {
return this.getAxesByScale("ordinal")[0] || this.getAxesByScale("time")[0] || this.getAngleAxis();
}, r.prototype.getTooltipAxes = function(e) {
var t = e != null && e !== "auto" ? this.getAxis(e) : this.getBaseAxis();
return {
baseAxes: [t],
otherAxes: [this.getOtherAxis(t)]
};
}, r.prototype.dataToPoint = function(e, t) {
return this.coordToPoint([this._radiusAxis.dataToRadius(e[0], t), this._angleAxis.dataToAngle(e[1], t)]);
}, r.prototype.pointToData = function(e, t) {
var n = this.pointToCoord(e);
return [this._radiusAxis.radiusToData(n[0], t), this._angleAxis.angleToData(n[1], t)];
}, r.prototype.pointToCoord = function(e) {
var t = e[0] - this.cx, n = e[1] - this.cy, a = this.getAngleAxis(), i = a.getExtent(), o = Math.min(i[0], i[1]), s = Math.max(i[0], i[1]);
a.inverse ? o = s - 360 : s = o + 360;
var l = Math.sqrt(t * t + n * n);
t /= l, n /= l;
for (var u = Math.atan2(-n, t) / Math.PI * 180, h = u < o ? 1 : -1; u < o || u > s; )
u += h * 360;
return [l, u];
}, r.prototype.coordToPoint = function(e) {
var t = e[0], n = e[1] / 180 * Math.PI, a = Math.cos(n) * t + this.cx, i = -Math.sin(n) * t + this.cy;
return [a, i];
}, r.prototype.getArea = function() {
var e = this.getAngleAxis(), t = this.getRadiusAxis(), n = t.getExtent().slice();
n[0] > n[1] && n.reverse();
var a = e.getExtent(), i = Math.PI / 180, o = 1e-4;
return {
cx: this.cx,
cy: this.cy,
r0: n[0],
r: n[1],
startAngle: -a[0] * i,
endAngle: -a[1] * i,
clockwise: e.inverse,
contain: function(s, l) {
var u = s - this.cx, h = l - this.cy, f = u * u + h * h, c = this.r, v = this.r0;
return c !== v && f - o <= c * c && f + o >= v * v;
}
};
}, r.prototype.convertToPixel = function(e, t, n) {
var a = Hb(t);
return a === this ? this.dataToPoint(n) : null;
}, r.prototype.convertFromPixel = function(e, t, n) {
var a = Hb(t);
return a === this ? this.pointToData(n) : null;
}, r;
}()
);
function Hb(r) {
var e = r.seriesModel, t = r.polarModel;
return t && t.coordinateSystem || e && e.coordinateSystem;
}
function N8(r, e, t) {
var n = e.get("center"), a = t.getWidth(), i = t.getHeight();
r.cx = W(n[0], a), r.cy = W(n[1], i);
var o = r.getRadiusAxis(), s = Math.min(a, i) / 2, l = e.get("radius");
l == null ? l = [0, "100%"] : z(l) || (l = [0, l]);
var u = [W(l[0], s), W(l[1], s)];
o.inverse ? o.setExtent(u[1], u[0]) : o.setExtent(u[0], u[1]);
}
function O8(r, e) {
var t = this, n = t.getAngleAxis(), a = t.getRadiusAxis();
if (n.scale.setExtent(1 / 0, -1 / 0), a.scale.setExtent(1 / 0, -1 / 0), r.eachSeries(function(s) {
if (s.coordinateSystem === t) {
var l = s.getData();
A(ef(l, "radius"), function(u) {
a.scale.unionExtentFromData(l, u);
}), A(ef(l, "angle"), function(u) {
n.scale.unionExtentFromData(l, u);
});
}
}), Io(n.scale, n.model), Io(a.scale, a.model), n.type === "category" && !n.onBand) {
var i = n.getExtent(), o = 360 / n.scale.count();
n.inverse ? i[1] += o : i[1] -= o, n.setExtent(i[0], i[1]);
}
}
function V8(r) {
return r.mainType === "angleAxis";
}
function Wb(r, e) {
var t;
if (r.type = e.get("type"), r.scale = hc(e), r.onBand = e.get("boundaryGap") && r.type === "category", r.inverse = e.get("inverse"), V8(e)) {
r.inverse = r.inverse !== e.get("clockwise");
var n = e.get("startAngle"), a = (t = e.get("endAngle")) !== null && t !== void 0 ? t : n + (r.inverse ? -360 : 360);
r.setExtent(n, a);
}
e.axis = r, r.model = e;
}
var B8 = {
dimensions: MI,
create: function(r, e) {
var t = [];
return r.eachComponent("polar", function(n, a) {
var i = new R8(a + "");
i.update = O8;
var o = i.getRadiusAxis(), s = i.getAngleAxis(), l = n.findAxisModel("radiusAxis"), u = n.findAxisModel("angleAxis");
Wb(o, l), Wb(s, u), N8(i, n, e), t.push(i), n.coordinateSystem = i, i.model = n;
}), r.eachSeries(function(n) {
if (n.get("coordinateSystem") === "polar") {
var a = n.getReferringComponents("polar", ne).models[0];
if (process.env.NODE_ENV !== "production" && !a)
throw new Error('Polar "' + re(n.get("polarIndex"), n.get("polarId"), 0) + '" not found');
n.coordinateSystem = a.coordinateSystem;
}
}), t;
}
}, z8 = ["axisLine", "axisLabel", "axisTick", "minorTick", "splitLine", "minorSplitLine", "splitArea"];
function Xu(r, e, t) {
e[1] > e[0] && (e = e.slice().reverse());
var n = r.coordToPoint([e[0], t]), a = r.coordToPoint([e[1], t]);
return {
x1: n[0],
y1: n[1],
x2: a[0],
y2: a[1]
};
}
function qu(r) {
var e = r.getRadiusAxis();
return e.inverse ? 0 : 1;
}
function $b(r) {
var e = r[0], t = r[r.length - 1];
e && t && Math.abs(Math.abs(e.coord - t.coord) - 360) < 1e-4 && r.pop();
}
var G8 = (
/** @class */
function(r) {
O(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t.type = e.type, t.axisPointerClass = "PolarAxisPointer", t;
}
return e.prototype.render = function(t, n) {
if (this.group.removeAll(), !!t.get("show")) {
var a = t.axis, i = a.polar, o = i.getRadiusAxis().getExtent(), s = a.getTicksCoords(), l = a.getMinorTicksCoords(), u = G(a.getViewLabels(), function(h) {
h = nt(h);
var f = a.scale, c = f.type === "ordinal" ? f.getRawOrdinalNumber(h.tickValue) : h.tickValue;
return h.coord = a.dataToCoord(c), h;
});
$b(u), $b(s), A(z8, function(h) {
t.get([h, "show"]) && (!a.scale.isBlank() || h === "axisLine") && F8[h](this.group, t, i, s, l, o, u);
}, this);
}
}, e.type = "angleAxis", e;
}(Oi)
), F8 = {
axisLine: function(r, e, t, n, a, i) {
var o = e.getModel(["axisLine", "lineStyle"]), s = t.getAngleAxis(), l = Math.PI / 180, u = s.getExtent(), h = qu(t), f = h ? 0 : 1, c, v = Math.abs(u[1] - u[0]) === 360 ? "Circle" : "Arc";
i[f] === 0 ? c = new Pi[v]({
shape: {
cx: t.cx,
cy: t.cy,
r: i[h],
startAngle: -u[0] * l,
endAngle: -u[1] * l,
clockwise: s.inverse
},
style: o.getLineStyle(),
z2: 1,
silent: !0
}) : c = new Bl({
shape: {
cx: t.cx,
cy: t.cy,
r: i[h],
r0: i[f]
},
style: o.getLineStyle(),
z2: 1,
silent: !0
}), c.style.fill = null, r.add(c);
},
axisTick: function(r, e, t, n, a, i) {
var o = e.getModel("axisTick"), s = (o.get("inside") ? -1 : 1) * o.get("length"), l = i[qu(t)], u = G(n, function(h) {
return new he({
shape: Xu(t, [l, l + s], h.coord)
});
});
r.add(dr(u, {
style: et(o.getModel("lineStyle").getLineStyle(), {
stroke: e.get(["axisLine", "lineStyle", "color"])
})
}));
},
minorTick: function(r, e, t, n, a, i) {
if (a.length) {
for (var o = e.getModel("axisTick"), s = e.getModel("minorTick"), l = (o.get("inside") ? -1 : 1) * s.get("length"), u = i[qu(t)], h = [], f = 0; f < a.length; f++)
for (var c = 0; c < a[f].length; c++)
h.push(new he({
shape: Xu(t, [u, u + l], a[f][c].coord)
}));
r.add(dr(h, {
style: et(s.getModel("lineStyle").getLineStyle(), et(o.getLineStyle(), {
stroke: e.get(["axisLine", "lineStyle", "color"])
}))
}));
}
},
axisLabel: function(r, e, t, n, a, i, o) {
var s = e.getCategories(!0), l = e.getModel("axisLabel"), u = l.get("margin"), h = e.get("triggerEvent");
A(o, function(f, c) {
var v = l, p = f.tickValue, d = i[qu(t)], g = t.coordToPoint([d + u, f.coord]), y = t.cx, m = t.cy, _ = Math.abs(g[0] - y) / d < 0.3 ? "center" : g[0] > y ? "left" : "right", S = Math.abs(g[1] - m) / d < 0.3 ? "middle" : g[1] > m ? "top" : "bottom";
if (s && s[p]) {
var x = s[p];
J(x) && x.textStyle && (v = new It(x.textStyle, l, l.ecModel));
}
var b = new wt({
silent: Oe.isLabelSilent(e),
style: Gt(v, {
x: g[0],
y: g[1],
fill: v.getTextColor() || e.get(["axisLine", "lineStyle", "color"]),
text: f.formattedLabel,
align: _,
verticalAlign: S
})
});
if (r.add(b), h) {
var w = Oe.makeAxisEventDataBase(e);
w.targetType = "axisLabel", w.value = f.rawLabel, it(b).eventData = w;
}
}, this);
},
splitLine: function(r, e, t, n, a, i) {
var o = e.getModel("splitLine"), s = o.getModel("lineStyle"), l = s.get("color"), u = 0;
l = l instanceof Array ? l : [l];
for (var h = [], f = 0; f < n.length; f++) {
var c = u++ % l.length;
h[c] = h[c] || [], h[c].push(new he({
shape: Xu(t, i, n[f].coord)
}));
}
for (var f = 0; f < h.length; f++)
r.add(dr(h[f], {
style: et({
stroke: l[f % l.length]
}, s.getLineStyle()),
silent: !0,
z: e.get("z")
}));
},
minorSplitLine: function(r, e, t, n, a, i) {
if (a.length) {
for (var o = e.getModel("minorSplitLine"), s = o.getModel("lineStyle"), l = [], u = 0; u < a.length; u++)
for (var h = 0; h < a[u].length; h++)
l.push(new he({
shape: Xu(t, i, a[u][h].coord)
}));
r.add(dr(l, {
style: s.getLineStyle(),
silent: !0,
z: e.get("z")
}));
}
},
splitArea: function(r, e, t, n, a, i) {
if (n.length) {
var o = e.getModel("splitArea"), s = o.getModel("areaStyle"), l = s.get("color"), u = 0;
l = l instanceof Array ? l : [l];
for (var h = [], f = Math.PI / 180, c = -n[0].coord * f, v = Math.min(i[0], i[1]), p = Math.max(i[0], i[1]), d = e.get("clockwise"), g = 1, y = n.length; g <= y; g++) {
var m = g === y ? n[0].coord : n[g].coord, _ = u++ % l.length;
h[_] = h[_] || [], h[_].push(new Ge({
shape: {
cx: t.cx,
cy: t.cy,
r0: v,
r: p,
startAngle: c,
endAngle: -m * f,
clockwise: d
},
silent: !0
})), c = -m * f;
}
for (var g = 0; g < h.length; g++)
r.add(dr(h[g], {
style: et({
fill: l[g % l.length]
}, s.getAreaStyle()),
silent: !0
}));
}
}
}, H8 = ["axisLine", "axisTickLabel", "axisName"], W8 = ["splitLine", "splitArea", "minorSplitLine"], $8 = (
/** @class */
function(r) {
O(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t.type = e.type, t.axisPointerClass = "PolarAxisPointer", t;
}
return e.prototype.render = function(t, n) {
if (this.group.removeAll(), !!t.get("show")) {
var a = this._axisGroup, i = this._axisGroup = new at();
this.group.add(i);
var o = t.axis, s = o.polar, l = s.getAngleAxis(), u = o.getTicksCoords(), h = o.getMinorTicksCoords(), f = l.getExtent()[0], c = o.getExtent(), v = Y8(s, t, f), p = new Oe(t, v);
A(H8, p.add, p), i.add(p.getGroup()), Fl(a, i, t), A(W8, function(d) {
t.get([d, "show"]) && !o.scale.isBlank() && U8[d](this.group, t, s, f, c, u, h);
}, this);
}
}, e.type = "radiusAxis", e;
}(Oi)
), U8 = {
splitLine: function(r, e, t, n, a, i) {
var o = e.getModel("splitLine"), s = o.getModel("lineStyle"), l = s.get("color"), u = 0, h = t.getAngleAxis(), f = Math.PI / 180, c = h.getExtent(), v = Math.abs(c[1] - c[0]) === 360 ? "Circle" : "Arc";
l = l instanceof Array ? l : [l];
for (var p = [], d = 0; d < i.length; d++) {
var g = u++ % l.length;
p[g] = p[g] || [], p[g].push(new Pi[v]({
shape: {
cx: t.cx,
cy: t.cy,
// ensure circle radius >= 0
r: Math.max(i[d].coord, 0),
startAngle: -c[0] * f,
endAngle: -c[1] * f,
clockwise: h.inverse
}
}));
}
for (var d = 0; d < p.length; d++)
r.add(dr(p[d], {
style: et({
stroke: l[d % l.length],
fill: null
}, s.getLineStyle()),
silent: !0
}));
},
minorSplitLine: function(r, e, t, n, a, i, o) {
if (o.length) {
for (var s = e.getModel("minorSplitLine"), l = s.getModel("lineStyle"), u = [], h = 0; h < o.length; h++)
for (var f = 0; f < o[h].length; f++)
u.push(new Nn({
shape: {
cx: t.cx,
cy: t.cy,
r: o[h][f].coord
}
}));
r.add(dr(u, {
style: et({
fill: null
}, l.getLineStyle()),
silent: !0
}));
}
},
splitArea: function(r, e, t, n, a, i) {
if (i.length) {
var o = e.getModel("splitArea"), s = o.getModel("areaStyle"), l = s.get("color"), u = 0;
l = l instanceof Array ? l : [l];
for (var h = [], f = i[0].coord, c = 1; c < i.length; c++) {
var v = u++ % l.length;
h[v] = h[v] || [], h[v].push(new Ge({
shape: {
cx: t.cx,
cy: t.cy,
r0: f,
r: i[c].coord,
startAngle: 0,
endAngle: Math.PI * 2
},
silent: !0
})), f = i[c].coord;
}
for (var c = 0; c < h.length; c++)
r.add(dr(h[c], {
style: et({
fill: l[c % l.length]
}, s.getAreaStyle()),
silent: !0
}));
}
}
};
function Y8(r, e, t) {
return {
position: [r.cx, r.cy],
rotation: t / 180 * Math.PI,
labelDirection: -1,
tickDirection: -1,
nameDirection: 1,
labelRotate: e.getModel("axisLabel").get("rotate"),
// Over splitLine and splitArea
z2: 1
};
}
function II(r) {
return r.get("stack") || "__ec_stack_" + r.seriesIndex;
}
function LI(r, e) {
return e.dim + r.model.componentIndex;
}
function Z8(r, e, t) {
var n = {}, a = X8(At(e.getSeriesByType(r), function(i) {
return !e.isSeriesFiltered(i) && i.coordinateSystem && i.coordinateSystem.type === "polar";
}));
e.eachSeriesByType(r, function(i) {
if (i.coordinateSystem.type === "polar") {
var o = i.getData(), s = i.coordinateSystem, l = s.getBaseAxis(), u = LI(s, l), h = II(i), f = a[u][h], c = f.offset, v = f.width, p = s.getOtherAxis(l), d = i.coordinateSystem.cx, g = i.coordinateSystem.cy, y = i.get("barMinHeight") || 0, m = i.get("barMinAngle") || 0;
n[h] = n[h] || [];
for (var _ = o.mapDimension(p.dim), S = o.mapDimension(l.dim), x = da(
o,
_
/* , baseDim */
), b = l.dim !== "radius" || !i.get("roundCap", !0), w = p.model, T = w.get("startValue"), C = p.dataToCoord(T || 0), D = 0, M = o.count(); D < M; D++) {
var I = o.get(_, D), L = o.get(S, D), E = I >= 0 ? "p" : "n", P = C;
x && (n[h][L] || (n[h][L] = {
p: C,
n: C
// Negative stack
}), P = n[h][L][E]);
var k = void 0, N = void 0, R = void 0, V = void 0;
if (p.dim === "radius") {
var F = p.dataToCoord(I) - C, H = l.dataToCoord(L);
Math.abs(F) < y && (F = (F < 0 ? -1 : 1) * y), k = P, N = P + F, R = H - c, V = R - v, x && (n[h][L][E] = N);
} else {
var $ = p.dataToCoord(I, b) - C, j = l.dataToCoord(L);
Math.abs($) < m && ($ = ($ < 0 ? -1 : 1) * m), k = j + c, N = k + v, R = P, V = P + $, x && (n[h][L][E] = V);
}
o.setItemLayout(D, {
cx: d,
cy: g,
r0: k,
r: N,
// Consider that positive angle is anti-clockwise,
// while positive radian of sector is clockwise
startAngle: -R * Math.PI / 180,
endAngle: -V * Math.PI / 180,
/**
* Keep the same logic with bar in catesion: use end value to
* control direction. Notice that if clockwise is true (by
* default), the sector will always draw clockwisely, no matter
* whether endAngle is greater or less than startAngle.
*/
clockwise: R >= V
});
}
}
});
}
function X8(r) {
var e = {};
A(r, function(n, a) {
var i = n.getData(), o = n.coordinateSystem, s = o.getBaseAxis(), l = LI(o, s), u = s.getExtent(), h = s.type === "category" ? s.getBandWidth() : Math.abs(u[1] - u[0]) / i.count(), f = e[l] || {
bandWidth: h,
remainedWidth: h,
autoWidthCount: 0,
categoryGap: "20%",
gap: "30%",
stacks: {}
}, c = f.stacks;
e[l] = f;
var v = II(n);
c[v] || f.autoWidthCount++, c[v] = c[v] || {
width: 0,
maxWidth: 0
};
var p = W(n.get("barWidth"), h), d = W(n.get("barMaxWidth"), h), g = n.get("barGap"), y = n.get("barCategoryGap");
p && !c[v].width && (p = Math.min(f.remainedWidth, p), c[v].width = p, f.remainedWidth -= p), d && (c[v].maxWidth = d), g != null && (f.gap = g), y != null && (f.categoryGap = y);
});
var t = {};
return A(e, function(n, a) {
t[a] = {};
var i = n.stacks, o = n.bandWidth, s = W(n.categoryGap, o), l = W(n.gap, 1), u = n.remainedWidth, h = n.autoWidthCount, f = (u - s) / (h + (h - 1) * l);
f = Math.max(f, 0), A(i, function(d, g) {
var y = d.maxWidth;
y && y < f && (y = Math.min(y, u), d.width && (y = Math.min(y, d.width)), u -= y, d.width = y, h--);
}), f = (u - s) / (h + (h - 1) * l), f = Math.max(f, 0);
var c = 0, v;
A(i, function(d, g) {
d.width || (d.width = f), v = d, c += d.width * (1 + l);
}), v && (c -= v.width * l);
var p = -c / 2;
A(i, function(d, g) {
t[a][g] = t[a][g] || {
offset: p,
width: d.width
}, p += d.width * (1 + l);
});
}), t;
}
var q8 = {
startAngle: 90,
clockwise: !0,
splitNumber: 12,
axisLabel: {
rotate: 0
}
}, K8 = {
splitNumber: 5
}, j8 = (
/** @class */
function(r) {
O(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t.type = e.type, t;
}
return e.type = "polar", e;
}(Yt)
);
function Q8(r) {
gt(tu), Oi.registerAxisPointerClass("PolarAxisPointer", A8), r.registerCoordinateSystem("polar", B8), r.registerComponentModel(L8), r.registerComponentView(j8), Eo(r, "angle", E8, q8), Eo(r, "radius", P8, K8), r.registerComponentView(G8), r.registerComponentView($8), r.registerLayout(ut(Z8, "bar"));
}
function Tg(r, e) {
e = e || {};
var t = r.coordinateSystem, n = r.axis, a = {}, i = n.position, o = n.orient, s = t.getRect(), l = [s.x, s.x + s.width, s.y, s.y + s.height], u = {
horizontal: {
top: l[2],
bottom: l[3]
},
vertical: {
left: l[0],
right: l[1]
}
};
a.position = [o === "vertical" ? u.vertical[i] : l[0], o === "horizontal" ? u.horizontal[i] : l[3]];
var h = {
horizontal: 0,
vertical: 1
};
a.rotation = Math.PI / 2 * h[o];
var f = {
top: -1,
bottom: 1,
right: 1,
left: -1
};
a.labelDirection = a.tickDirection = a.nameDirection = f[i], r.get(["axisTick", "inside"]) && (a.tickDirection = -a.tickDirection), re(e.labelInside, r.get(["axisLabel", "inside"])) && (a.labelDirection = -a.labelDirection);
var c = e.rotate;
return c == null && (c = r.get(["axisLabel", "rotate"])), a.labelRotation = i === "top" ? -c : c, a.z2 = 1, a;
}
var J8 = ["axisLine", "axisTickLabel", "axisName"], t7 = ["splitArea", "splitLine"], e7 = (
/** @class */
function(r) {
O(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t.type = e.type, t.axisPointerClass = "SingleAxisPointer", t;
}
return e.prototype.render = function(t, n, a, i) {
var o = this.group;
o.removeAll();
var s = this._axisGroup;
this._axisGroup = new at();
var l = Tg(t), u = new Oe(t, l);
A(J8, u.add, u), o.add(this._axisGroup), o.add(u.getGroup()), A(t7, function(h) {
t.get([h, "show"]) && r7[h](this, this.group, this._axisGroup, t);
}, this), Fl(s, this._axisGroup, t), r.prototype.render.call(this, t, n, a, i);
}, e.prototype.remove = function() {
jM(this);
}, e.type = "singleAxis", e;
}(Oi)
), r7 = {
splitLine: function(r, e, t, n) {
var a = n.axis;
if (!a.scale.isBlank()) {
var i = n.getModel("splitLine"), o = i.getModel("lineStyle"), s = o.get("color");
s = s instanceof Array ? s : [s];
for (var l = o.get("width"), u = n.coordinateSystem.getRect(), h = a.isHorizontal(), f = [], c = 0, v = a.getTicksCoords({
tickModel: i
}), p = [], d = [], g = 0; g < v.length; ++g) {
var y = a.toGlobalCoord(v[g].coord);
h ? (p[0] = y, p[1] = u.y, d[0] = y, d[1] = u.y + u.height) : (p[0] = u.x, p[1] = y, d[0] = u.x + u.width, d[1] = y);
var m = new he({
shape: {
x1: p[0],
y1: p[1],
x2: d[0],
y2: d[1]
},
silent: !0
});
Do(m.shape, l);
var _ = c++ % s.length;
f[_] = f[_] || [], f[_].push(m);
}
for (var S = o.getLineStyle(["color"]), g = 0; g < f.length; ++g)
e.add(dr(f[g], {
style: et({
stroke: s[g % s.length]
}, S),
silent: !0
}));
}
},
splitArea: function(r, e, t, n) {
KM(r, t, n, n);
}
}, bh = (
/** @class */
function(r) {
O(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t.type = e.type, t;
}
return e.prototype.getCoordSysModel = function() {
return this;
}, e.type = "singleAxis", e.layoutMode = "box", e.defaultOption = {
left: "5%",
top: "5%",
right: "5%",
bottom: "5%",
type: "value",
position: "bottom",
orient: "horizontal",
axisLine: {
show: !0,
lineStyle: {
width: 1,
type: "solid"
}
},
// Single coordinate system and single axis is the,
// which is used as the parent tooltip model.
// same model, so we set default tooltip show as true.
tooltip: {
show: !0
},
axisTick: {
show: !0,
length: 6,
lineStyle: {
width: 1
}
},
axisLabel: {
show: !0,
interval: "auto"
},
splitLine: {
show: !0,
lineStyle: {
type: "dashed",
opacity: 0.2
}
}
}, e;
}(_t)
);
ie(bh, Ul.prototype);
var n7 = (
/** @class */
function(r) {
O(e, r);
function e(t, n, a, i, o) {
var s = r.call(this, t, n, a) || this;
return s.type = i || "value", s.position = o || "bottom", s;
}
return e.prototype.isHorizontal = function() {
var t = this.position;
return t === "top" || t === "bottom";
}, e.prototype.pointToData = function(t, n) {
return this.coordinateSystem.pointToData(t)[0];
}, e;
}(Br)
), EI = ["single"], a7 = (
/** @class */
function() {
function r(e, t, n) {
this.type = "single", this.dimension = "single", this.dimensions = EI, this.axisPointerEnabled = !0, this.model = e, this._init(e, t, n);
}
return r.prototype._init = function(e, t, n) {
var a = this.dimension, i = new n7(a, hc(e), [0, 0], e.get("type"), e.get("position")), o = i.type === "category";
i.onBand = o && e.get("boundaryGap"), i.inverse = e.get("inverse"), i.orient = e.get("orient"), e.axis = i, i.model = e, i.coordinateSystem = this, this._axis = i;
}, r.prototype.update = function(e, t) {
e.eachSeries(function(n) {
if (n.coordinateSystem === this) {
var a = n.getData();
A(a.mapDimensionsAll(this.dimension), function(i) {
this._axis.scale.unionExtentFromData(a, i);
}, this), Io(this._axis.scale, this._axis.model);
}
}, this);
}, r.prototype.resize = function(e, t) {
this._rect = se({
left: e.get("left"),
top: e.get("top"),
right: e.get("right"),
bottom: e.get("bottom"),
width: e.get("width"),
height: e.get("height")
}, {
width: t.getWidth(),
height: t.getHeight()
}), this._adjustAxis();
}, r.prototype.getRect = function() {
return this._rect;
}, r.prototype._adjustAxis = function() {
var e = this._rect, t = this._axis, n = t.isHorizontal(), a = n ? [0, e.width] : [0, e.height], i = t.inverse ? 1 : 0;
t.setExtent(a[i], a[1 - i]), this._updateAxisTransform(t, n ? e.x : e.y);
}, r.prototype._updateAxisTransform = function(e, t) {
var n = e.getExtent(), a = n[0] + n[1], i = e.isHorizontal();
e.toGlobalCoord = i ? function(o) {
return o + t;
} : function(o) {
return a - o + t;
}, e.toLocalCoord = i ? function(o) {
return o - t;
} : function(o) {
return a - o + t;
};
}, r.prototype.getAxis = function() {
return this._axis;
}, r.prototype.getBaseAxis = function() {
return this._axis;
}, r.prototype.getAxes = function() {
return [this._axis];
}, r.prototype.getTooltipAxes = function() {
return {
baseAxes: [this.getAxis()],
// Empty otherAxes
otherAxes: []
};
}, r.prototype.containPoint = function(e) {
var t = this.getRect(), n = this.getAxis(), a = n.orient;
return a === "horizontal" ? n.contain(n.toLocalCoord(e[0])) && e[1] >= t.y && e[1] <= t.y + t.height : n.contain(n.toLocalCoord(e[1])) && e[0] >= t.y && e[0] <= t.y + t.height;
}, r.prototype.pointToData = function(e) {
var t = this.getAxis();
return [t.coordToData(t.toLocalCoord(e[t.orient === "horizontal" ? 0 : 1]))];
}, r.prototype.dataToPoint = function(e) {
var t = this.getAxis(), n = this.getRect(), a = [], i = t.orient === "horizontal" ? 0 : 1;
return e instanceof Array && (e = e[0]), a[i] = t.toGlobalCoord(t.dataToCoord(+e)), a[1 - i] = i === 0 ? n.y + n.height / 2 : n.x + n.width / 2, a;
}, r.prototype.convertToPixel = function(e, t, n) {
var a = Ub(t);
return a === this ? this.dataToPoint(n) : null;
}, r.prototype.convertFromPixel = function(e, t, n) {
var a = Ub(t);
return a === this ? this.pointToData(n) : null;
}, r;
}()
);
function Ub(r) {
var e = r.seriesModel, t = r.singleAxisModel;
return t && t.coordinateSystem || e && e.coordinateSystem;
}
function i7(r, e) {
var t = [];
return r.eachComponent("singleAxis", function(n, a) {
var i = new a7(n, r, e);
i.name = "single_" + a, i.resize(n, e), n.coordinateSystem = i, t.push(i);
}), r.eachSeries(function(n) {
if (n.get("coordinateSystem") === "singleAxis") {
var a = n.getReferringComponents("singleAxis", ne).models[0];
n.coordinateSystem = a && a.coordinateSystem;
}
}), t;
}
var o7 = {
create: i7,
dimensions: EI
}, Yb = ["x", "y"], s7 = ["width", "height"], l7 = (
/** @class */
function(r) {
O(e, r);
function e() {
return r !== null && r.apply(this, arguments) || this;
}
return e.prototype.makeElOption = function(t, n, a, i, o) {
var s = a.axis, l = s.coordinateSystem, u = Ap(l, 1 - mf(s)), h = l.dataToPoint(n)[0], f = i.get("type");
if (f && f !== "none") {
var c = Bm(i), v = u7[f](s, h, u);
v.style = c, t.graphicKey = v.type, t.pointer = v;
}
var p = Tg(a);
TI(
// @ts-ignore
n,
t,
p,
a,
i,
o
);
}, e.prototype.getHandleTransform = function(t, n, a) {
var i = Tg(n, {
labelInside: !1
});
i.labelMargin = a.get(["handle", "margin"]);
var o = zm(n.axis, t, i);
return {
x: o[0],
y: o[1],
rotation: i.rotation + (i.labelDirection < 0 ? Math.PI : 0)
};
}, e.prototype.updateHandleTransform = function(t, n, a, i) {
var o = a.axis, s = o.coordinateSystem, l = mf(o), u = Ap(s, l), h = [t.x, t.y];
h[l] += n[l], h[l] = Math.min(u[1], h[l]), h[l] = Math.max(u[0], h[l]);
var f = Ap(s, 1 - l), c = (f[1] + f[0]) / 2, v = [c, c];
return v[l] = h[l], {
x: h[0],
y: h[1],
rotation: t.rotation,
cursorPoint: v,
tooltipOption: {
verticalAlign: "middle"
}
};
}, e;
}(Vm)
), u7 = {
line: function(r, e, t) {
var n = Gm([e, t[0]], [e, t[1]], mf(r));
return {
type: "Line",
subPixelOptimize: !0,
shape: n
};
},
shadow: function(r, e, t) {
var n = r.getBandWidth(), a = t[1] - t[0];
return {
type: "Rect",
shape: CI([e - n / 2, t[0]], [n, a], mf(r))
};
}
};
function mf(r) {
return r.isHorizontal() ? 0 : 1;
}
function Ap(r, e) {
var t = r.getRect();
return [t[Yb[e]], t[Yb[e]] + t[s7[e]]];
}
var h7 = (
/** @class */
function(r) {
O(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t.type = e.type, t;
}
return e.type = "single", e;
}(Yt)
);
function f7(r) {
gt(tu), Oi.registerAxisPointerClass("SingleAxisPointer", l7), r.registerComponentView(h7), r.registerComponentView(e7), r.registerComponentModel(bh), Eo(r, "single", bh, bh.defaultOption), r.registerCoordinateSystem("single", o7);
}
var c7 = (
/** @class */
function(r) {
O(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t.type = e.type, t;
}
return e.prototype.init = function(t, n, a) {
var i = $o(t);
r.prototype.init.apply(this, arguments), Zb(t, i);
}, e.prototype.mergeOption = function(t) {
r.prototype.mergeOption.apply(this, arguments), Zb(this.option, t);
}, e.prototype.getCellSize = function() {
return this.option.cellSize;
}, e.type = "calendar", e.defaultOption = {
// zlevel: 0,
z: 2,
left: 80,
top: 60,
cellSize: 20,
// horizontal vertical
orient: "horizontal",
// month separate line style
splitLine: {
show: !0,
lineStyle: {
color: "#000",
width: 1,
type: "solid"
}
},
// rect style temporarily unused emphasis
itemStyle: {
color: "#fff",
borderWidth: 1,
borderColor: "#ccc"
},
// week text style
dayLabel: {
show: !0,
firstDay: 0,
// start end
position: "start",
margin: "50%",
color: "#000"
},
// month text style
monthLabel: {
show: !0,
// start end
position: "start",
margin: 5,
// center or left
align: "center",
formatter: null,
color: "#000"
},
// year text style
yearLabel: {
show: !0,
// top bottom left right
position: null,
margin: 30,
formatter: null,
color: "#ccc",
fontFamily: "sans-serif",
fontWeight: "bolder",
fontSize: 20
}
}, e;
}(_t)
);
function Zb(r, e) {
var t = r.cellSize, n;
z(t) ? n = t : n = r.cellSize = [t, t], n.length === 1 && (n[1] = n[0]);
var a = G([0, 1], function(i) {
return LN(e, i) && (n[i] = "auto"), n[i] != null && n[i] !== "auto";
});
pa(r, e, {
type: "box",
ignoreSize: a
});
}
var v7 = (
/** @class */
function(r) {
O(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t.type = e.type, t;
}
return e.prototype.render = function(t, n, a) {
var i = this.group;
i.removeAll();
var o = t.coordinateSystem, s = o.getRangeInfo(), l = o.getOrient(), u = n.getLocaleModel();
this._renderDayRect(t, s, i), this._renderLines(t, s, l, i), this._renderYearText(t, s, l, i), this._renderMonthText(t, u, l, i), this._renderWeekText(t, u, s, l, i);
}, e.prototype._renderDayRect = function(t, n, a) {
for (var i = t.coordinateSystem, o = t.getModel("itemStyle").getItemStyle(), s = i.getCellWidth(), l = i.getCellHeight(), u = n.start.time; u <= n.end.time; u = i.getNextNDay(u, 1).time) {
var h = i.dataToRect([u], !1).tl, f = new xt({
shape: {
x: h[0],
y: h[1],
width: s,
height: l
},
cursor: "default",
style: o
});
a.add(f);
}
}, e.prototype._renderLines = function(t, n, a, i) {
var o = this, s = t.coordinateSystem, l = t.getModel(["splitLine", "lineStyle"]).getLineStyle(), u = t.get(["splitLine", "show"]), h = l.lineWidth;
this._tlpoints = [], this._blpoints = [], this._firstDayOfMonth = [], this._firstDayPoints = [];
for (var f = n.start, c = 0; f.time <= n.end.time; c++) {
p(f.formatedDate), c === 0 && (f = s.getDateInfo(n.start.y + "-" + n.start.m));
var v = f.date;
v.setMonth(v.getMonth() + 1), f = s.getDateInfo(v);
}
p(s.getNextNDay(n.end.time, 1).formatedDate);
function p(d) {
o._firstDayOfMonth.push(s.getDateInfo(d)), o._firstDayPoints.push(s.dataToRect([d], !1).tl);
var g = o._getLinePointsOfOneWeek(t, d, a);
o._tlpoints.push(g[0]), o._blpoints.push(g[g.length - 1]), u && o._drawSplitline(g, l, i);
}
u && this._drawSplitline(o._getEdgesPoints(o._tlpoints, h, a), l, i), u && this._drawSplitline(o._getEdgesPoints(o._blpoints, h, a), l, i);
}, e.prototype._getEdgesPoints = function(t, n, a) {
var i = [t[0].slice(), t[t.length - 1].slice()], o = a === "horizontal" ? 0 : 1;
return i[0][o] = i[0][o] - n / 2, i[1][o] = i[1][o] + n / 2, i;
}, e.prototype._drawSplitline = function(t, n, a) {
var i = new He({
z2: 20,
shape: {
points: t
},
style: n
});
a.add(i);
}, e.prototype._getLinePointsOfOneWeek = function(t, n, a) {
for (var i = t.coordinateSystem, o = i.getDateInfo(n), s = [], l = 0; l < 7; l++) {
var u = i.getNextNDay(o.time, l), h = i.dataToRect([u.time], !1);
s[2 * u.day] = h.tl, s[2 * u.day + 1] = h[a === "horizontal" ? "bl" : "tr"];
}
return s;
}, e.prototype._formatterLabel = function(t, n) {
return U(t) && t ? AN(t, n) : K(t) ? t(n) : n.nameMap;
}, e.prototype._yearTextPositionControl = function(t, n, a, i, o) {
var s = n[0], l = n[1], u = ["center", "bottom"];
i === "bottom" ? (l += o, u = ["center", "top"]) : i === "left" ? s -= o : i === "right" ? (s += o, u = ["center", "top"]) : l -= o;
var h = 0;
return (i === "left" || i === "right") && (h = Math.PI / 2), {
rotation: h,
x: s,
y: l,
style: {
align: u[0],
verticalAlign: u[1]
}
};
}, e.prototype._renderYearText = function(t, n, a, i) {
var o = t.getModel("yearLabel");
if (o.get("show")) {
var s = o.get("margin"), l = o.get("position");
l || (l = a !== "horizontal" ? "top" : "left");
var u = [this._tlpoints[this._tlpoints.length - 1], this._blpoints[0]], h = (u[0][0] + u[1][0]) / 2, f = (u[0][1] + u[1][1]) / 2, c = a === "horizontal" ? 0 : 1, v = {
top: [h, u[c][1]],
bottom: [h, u[1 - c][1]],
left: [u[1 - c][0], f],
right: [u[c][0], f]
}, p = n.start.y;
+n.end.y > +n.start.y && (p = p + "-" + n.end.y);
var d = o.get("formatter"), g = {
start: n.start.y,
end: n.end.y,
nameMap: p
}, y = this._formatterLabel(d, g), m = new wt({
z2: 30,
style: Gt(o, {
text: y
}),
silent: o.get("silent")
});
m.attr(this._yearTextPositionControl(m, v[l], a, l, s)), i.add(m);
}
}, e.prototype._monthTextPositionControl = function(t, n, a, i, o) {
var s = "left", l = "top", u = t[0], h = t[1];
return a === "horizontal" ? (h = h + o, n && (s = "center"), i === "start" && (l = "bottom")) : (u = u + o, n && (l = "middle"), i === "start" && (s = "right")), {
x: u,
y: h,
align: s,
verticalAlign: l
};
}, e.prototype._renderMonthText = function(t, n, a, i) {
var o = t.getModel("monthLabel");
if (o.get("show")) {
var s = o.get("nameMap"), l = o.get("margin"), u = o.get("position"), h = o.get("align"), f = [this._tlpoints, this._blpoints];
(!s || U(s)) && (s && (n = Pd(s) || n), s = n.get(["time", "monthAbbr"]) || []);
var c = u === "start" ? 0 : 1, v = a === "horizontal" ? 0 : 1;
l = u === "start" ? -l : l;
for (var p = h === "center", d = o.get("silent"), g = 0; g < f[c].length - 1; g++) {
var y = f[c][g].slice(), m = this._firstDayOfMonth[g];
if (p) {
var _ = this._firstDayPoints[g];
y[v] = (_[v] + f[0][g + 1][v]) / 2;
}
var S = o.get("formatter"), x = s[+m.m - 1], b = {
yyyy: m.y,
yy: (m.y + "").slice(2),
MM: m.m,
M: +m.m,
nameMap: x
}, w = this._formatterLabel(S, b), T = new wt({
z2: 30,
style: B(Gt(o, {
text: w
}), this._monthTextPositionControl(y, p, a, u, l)),
silent: d
});
i.add(T);
}
}
}, e.prototype._weekTextPositionControl = function(t, n, a, i, o) {
var s = "center", l = "middle", u = t[0], h = t[1], f = a === "start";
return n === "horizontal" ? (u = u + i + (f ? 1 : -1) * o[0] / 2, s = f ? "right" : "left") : (h = h + i + (f ? 1 : -1) * o[1] / 2, l = f ? "bottom" : "top"), {
x: u,
y: h,
align: s,
verticalAlign: l
};
}, e.prototype._renderWeekText = function(t, n, a, i, o) {
var s = t.getModel("dayLabel");
if (s.get("show")) {
var l = t.coordinateSystem, u = s.get("position"), h = s.get("nameMap"), f = s.get("margin"), c = l.getFirstDayOfWeek();
if (!h || U(h)) {
h && (n = Pd(h) || n);
var v = n.get(["time", "dayOfWeekShort"]);
h = v || G(n.get(["time", "dayOfWeekAbbr"]), function(b) {
return b[0];
});
}
var p = l.getNextNDay(a.end.time, 7 - a.lweek).time, d = [l.getCellWidth(), l.getCellHeight()];
f = W(f, Math.min(d[1], d[0])), u === "start" && (p = l.getNextNDay(a.start.time, -(7 + a.fweek)).time, f = -f);
for (var g = s.get("silent"), y = 0; y < 7; y++) {
var m = l.getNextNDay(p, y), _ = l.dataToRect([m.time], !1).center, S = y;
S = Math.abs((y + c) % 7);
var x = new wt({
z2: 30,
style: B(Gt(s, {
text: h[S]
}), this._weekTextPositionControl(_, i, u, f, d)),
silent: g
});
o.add(x);
}
}
}, e.type = "calendar", e;
}(Yt)
), Mp = 864e5, p7 = (
/** @class */
function() {
function r(e, t, n) {
this.type = "calendar", this.dimensions = r.dimensions, this.getDimensionsInfo = r.getDimensionsInfo, this._model = e;
}
return r.getDimensionsInfo = function() {
return [{
name: "time",
type: "time"
}, "value"];
}, r.prototype.getRangeInfo = function() {
return this._rangeInfo;
}, r.prototype.getModel = function() {
return this._model;
}, r.prototype.getRect = function() {
return this._rect;
}, r.prototype.getCellWidth = function() {
return this._sw;
}, r.prototype.getCellHeight = function() {
return this._sh;
}, r.prototype.getOrient = function() {
return this._orient;
}, r.prototype.getFirstDayOfWeek = function() {
return this._firstDayOfWeek;
}, r.prototype.getDateInfo = function(e) {
e = on(e);
var t = e.getFullYear(), n = e.getMonth() + 1, a = n < 10 ? "0" + n : "" + n, i = e.getDate(), o = i < 10 ? "0" + i : "" + i, s = e.getDay();
return s = Math.abs((s + 7 - this.getFirstDayOfWeek()) % 7), {
y: t + "",
m: a,
d: o,
day: s,
time: e.getTime(),
formatedDate: t + "-" + a + "-" + o,
date: e
};
}, r.prototype.getNextNDay = function(e, t) {
return t = t || 0, t === 0 ? this.getDateInfo(e) : (e = new Date(this.getDateInfo(e).time), e.setDate(e.getDate() + t), this.getDateInfo(e));
}, r.prototype.update = function(e, t) {
this._firstDayOfWeek = +this._model.getModel("dayLabel").get("firstDay"), this._orient = this._model.get("orient"), this._lineWidth = this._model.getModel("itemStyle").getItemStyle().lineWidth || 0, this._rangeInfo = this._getRangeInfo(this._initRangeOption());
var n = this._rangeInfo.weeks || 1, a = ["width", "height"], i = this._model.getCellSize().slice(), o = this._model.getBoxLayoutParams(), s = this._orient === "horizontal" ? [n, 7] : [7, n];
A([0, 1], function(f) {
h(i, f) && (o[a[f]] = i[f] * s[f]);
});
var l = {
width: t.getWidth(),
height: t.getHeight()
}, u = this._rect = se(o, l);
A([0, 1], function(f) {
h(i, f) || (i[f] = u[a[f]] / s[f]);
});
function h(f, c) {
return f[c] != null && f[c] !== "auto";
}
this._sw = i[0], this._sh = i[1];
}, r.prototype.dataToPoint = function(e, t) {
z(e) && (e = e[0]), t == null && (t = !0);
var n = this.getDateInfo(e), a = this._rangeInfo, i = n.formatedDate;
if (t && !(n.time >= a.start.time && n.time < a.end.time + Mp))
return [NaN, NaN];
var o = n.day, s = this._getRangeInfo([a.start.time, i]).nthWeek;
return this._orient === "vertical" ? [this._rect.x + o * this._sw + this._sw / 2, this._rect.y + s * this._sh + this._sh / 2] : [this._rect.x + s * this._sw + this._sw / 2, this._rect.y + o * this._sh + this._sh / 2];
}, r.prototype.pointToData = function(e) {
var t = this.pointToDate(e);
return t && t.time;
}, r.prototype.dataToRect = function(e, t) {
var n = this.dataToPoint(e, t);
return {
contentShape: {
x: n[0] - (this._sw - this._lineWidth) / 2,
y: n[1] - (this._sh - this._lineWidth) / 2,
width: this._sw - this._lineWidth,
height: this._sh - this._lineWidth
},
center: n,
tl: [n[0] - this._sw / 2, n[1] - this._sh / 2],
tr: [n[0] + this._sw / 2, n[1] - this._sh / 2],
br: [n[0] + this._sw / 2, n[1] + this._sh / 2],
bl: [n[0] - this._sw / 2, n[1] + this._sh / 2]
};
}, r.prototype.pointToDate = function(e) {
var t = Math.floor((e[0] - this._rect.x) / this._sw) + 1, n = Math.floor((e[1] - this._rect.y) / this._sh) + 1, a = this._rangeInfo.range;
return this._orient === "vertical" ? this._getDateByWeeksAndDay(n, t - 1, a) : this._getDateByWeeksAndDay(t, n - 1, a);
}, r.prototype.convertToPixel = function(e, t, n) {
var a = Xb(t);
return a === this ? a.dataToPoint(n) : null;
}, r.prototype.convertFromPixel = function(e, t, n) {
var a = Xb(t);
return a === this ? a.pointToData(n) : null;
}, r.prototype.containPoint = function(e) {
return console.warn("Not implemented."), !1;
}, r.prototype._initRangeOption = function() {
var e = this._model.get("range"), t;
if (z(e) && e.length === 1 && (e = e[0]), z(e))
t = e;
else {
var n = e.toString();
if (/^\d{4}$/.test(n) && (t = [n + "-01-01", n + "-12-31"]), /^\d{4}[\/|-]\d{1,2}$/.test(n)) {
var a = this.getDateInfo(n), i = a.date;
i.setMonth(i.getMonth() + 1);
var o = this.getNextNDay(i, -1);
t = [a.formatedDate, o.formatedDate];
}
/^\d{4}[\/|-]\d{1,2}[\/|-]\d{1,2}$/.test(n) && (t = [n, n]);
}
if (!t)
return process.env.NODE_ENV !== "production" && Er("Invalid date range."), e;
var s = this._getRangeInfo(t);
return s.start.time > s.end.time && t.reverse(), t;
}, r.prototype._getRangeInfo = function(e) {
var t = [this.getDateInfo(e[0]), this.getDateInfo(e[1])], n;
t[0].time > t[1].time && (n = !0, t.reverse());
var a = Math.floor(t[1].time / Mp) - Math.floor(t[0].time / Mp) + 1, i = new Date(t[0].time), o = i.getDate(), s = t[1].date.getDate();
i.setDate(o + a - 1);
var l = i.getDate();
if (l !== s)
for (var u = i.getTime() - t[1].time > 0 ? 1 : -1; (l = i.getDate()) !== s && (i.getTime() - t[1].time) * u > 0; )
a -= u, i.setDate(l - u);
var h = Math.floor((a + t[0].day + 6) / 7), f = n ? -h + 1 : h - 1;
return n && t.reverse(), {
range: [t[0].formatedDate, t[1].formatedDate],
start: t[0],
end: t[1],
allDay: a,
weeks: h,
// From 0.
nthWeek: f,
fweek: t[0].day,
lweek: t[1].day
};
}, r.prototype._getDateByWeeksAndDay = function(e, t, n) {
var a = this._getRangeInfo(n);
if (e > a.weeks || e === 0 && t < a.fweek || e === a.weeks && t > a.lweek)
return null;
var i = (e - 1) * 7 - a.fweek + t, o = new Date(a.start.time);
return o.setDate(+a.start.d + i), this.getDateInfo(o);
}, r.create = function(e, t) {
var n = [];
return e.eachComponent("calendar", function(a) {
var i = new r(a);
n.push(i), a.coordinateSystem = i;
}), e.eachSeries(function(a) {
a.get("coordinateSystem") === "calendar" && (a.coordinateSystem = n[a.get("calendarIndex") || 0]);
}), n;
}, r.dimensions = ["time", "value"], r;
}()
);
function Xb(r) {
var e = r.calendarModel, t = r.seriesModel, n = e ? e.coordinateSystem : t ? t.coordinateSystem : null;
return n;
}
function d7(r) {
r.registerComponentModel(c7), r.registerComponentView(v7), r.registerCoordinateSystem("calendar", p7);
}
function g7(r, e) {
var t = r.existing;
if (e.id = r.keyInfo.id, !e.type && t && (e.type = t.type), e.parentId == null) {
var n = e.parentOption;
n ? e.parentId = n.id : t && (e.parentId = t.parentId);
}
e.parentOption = null;
}
function qb(r, e) {
var t;
return A(e, function(n) {
r[n] != null && r[n] !== "auto" && (t = !0);
}), t;
}
function y7(r, e, t) {
var n = B({}, t), a = r[e], i = t.$action || "merge";
if (i === "merge")
if (a) {
if (process.env.NODE_ENV !== "production") {
var o = t.type;
tt(!o || a.type === o, 'Please set $action: "replace" to change `type`');
}
ht(a, n, !0), pa(a, n, {
ignoreSize: !0
}), TD(t, a), Ku(t, a), Ku(t, a, "shape"), Ku(t, a, "style"), Ku(t, a, "extra"), t.clipPath = a.clipPath;
} else
r[e] = n;
else i === "replace" ? r[e] = n : i === "remove" && a && (r[e] = null);
}
var PI = ["transition", "enterFrom", "leaveTo"], m7 = PI.concat(["enterAnimation", "updateAnimation", "leaveAnimation"]);
function Ku(r, e, t) {
if (t && (!r[t] && e[t] && (r[t] = {}), r = r[t], e = e[t]), !(!r || !e))
for (var n = t ? PI : m7, a = 0; a < n.length; a++) {
var i = n[a];
r[i] == null && e[i] != null && (r[i] = e[i]);
}
}
function _7(r, e) {
if (r && (r.hv = e.hv = [
// Rigid body, don't care about `width`.
qb(e, ["left", "right"]),
// Rigid body, don't care about `height`.
qb(e, ["top", "bottom"])
], r.type === "group")) {
var t = r, n = e;
t.width == null && (t.width = n.width = 0), t.height == null && (t.height = n.height = 0);
}
}
var S7 = (
/** @class */
function(r) {
O(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t.type = e.type, t.preventAutoZ = !0, t;
}
return e.prototype.mergeOption = function(t, n) {
var a = this.option.elements;
this.option.elements = null, r.prototype.mergeOption.call(this, t, n), this.option.elements = a;
}, e.prototype.optionUpdated = function(t, n) {
var a = this.option, i = (n ? a : t).elements, o = a.elements = n ? [] : a.elements, s = [];
this._flatten(i, s, null);
var l = SC(o, s, "normalMerge"), u = this._elOptionsToUpdate = [];
A(l, function(h, f) {
var c = h.newOption;
process.env.NODE_ENV !== "production" && tt(J(c) || h.existing, "Empty graphic option definition"), c && (u.push(c), g7(h, c), y7(o, f, c), _7(o[f], c));
}, this), a.elements = At(o, function(h) {
return h && delete h.$action, h != null;
});
}, e.prototype._flatten = function(t, n, a) {
A(t, function(i) {
if (i) {
a && (i.parentOption = a), n.push(i);
var o = i.children;
o && o.length && this._flatten(o, n, i), delete i.children;
}
}, this);
}, e.prototype.useElOptionsToUpdate = function() {
var t = this._elOptionsToUpdate;
return this._elOptionsToUpdate = null, t;
}, e.type = "graphic", e.defaultOption = {
elements: []
// parentId: null
}, e;
}(_t)
), Kb = {
// Reserved but not supported in graphic component.
path: null,
compoundPath: null,
// Supported in graphic component.
group: at,
image: ge,
text: wt
}, cr = bt(), x7 = (
/** @class */
function(r) {
O(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t.type = e.type, t;
}
return e.prototype.init = function() {
this._elMap = X();
}, e.prototype.render = function(t, n, a) {
t !== this._lastGraphicModel && this._clear(), this._lastGraphicModel = t, this._updateElements(t), this._relocate(t, a);
}, e.prototype._updateElements = function(t) {
var n = t.useElOptionsToUpdate();
if (n) {
var a = this._elMap, i = this.group, o = t.get("z"), s = t.get("zlevel");
A(n, function(l) {
var u = oe(l.id, null), h = u != null ? a.get(u) : null, f = oe(l.parentId, null), c = f != null ? a.get(f) : i, v = l.type, p = l.style;
v === "text" && p && l.hv && l.hv[1] && (p.textVerticalAlign = p.textBaseline = p.verticalAlign = p.align = null);
var d = l.textContent, g = l.textConfig;
if (p && fI(p, v, !!g, !!d)) {
var y = cI(p, v, !0);
!g && y.textConfig && (g = l.textConfig = y.textConfig), !d && y.textContent && (d = y.textContent);
}
var m = b7(l);
process.env.NODE_ENV !== "production" && h && tt(c === h.parent, "Changing parent is not supported.");
var _ = l.$action || "merge", S = _ === "merge", x = _ === "replace";
if (S) {
var b = !h, w = h;
b ? w = jb(u, c, l.type, a) : (w && (cr(w).isNew = !1), yI(w)), w && (Sh(w, m, t, {
isInit: b
}), Qb(w, l, o, s));
} else if (x) {
wh(h, l, a, t);
var T = jb(u, c, l.type, a);
T && (Sh(T, m, t, {
isInit: !0
}), Qb(T, l, o, s));
} else _ === "remove" && (pI(h, l), wh(h, l, a, t));
var C = a.get(u);
if (C && d)
if (S) {
var D = C.getTextContent();
D ? D.attr(d) : C.setTextContent(new wt(d));
} else x && C.setTextContent(new wt(d));
if (C) {
var M = l.clipPath;
if (M) {
var I = M.type, L = void 0, b = !1;
if (S) {
var E = C.getClipPath();
b = !E || cr(E).type !== I, L = b ? Cg(I) : E;
} else x && (b = !0, L = Cg(I));
C.setClipPath(L), Sh(L, M, t, {
isInit: b
}), df(L, M.keyframeAnimation, t);
}
var P = cr(C);
C.setTextConfig(g), P.option = l, w7(C, t, l), Ei({
el: C,
componentModel: t,
itemName: C.name,
itemTooltipOption: l.tooltip
}), df(C, l.keyframeAnimation, t);
}
});
}
}, e.prototype._relocate = function(t, n) {
for (var a = t.option.elements, i = this.group, o = this._elMap, s = n.getWidth(), l = n.getHeight(), u = ["x", "y"], h = 0; h < a.length; h++) {
var f = a[h], c = oe(f.id, null), v = c != null ? o.get(c) : null;
if (!(!v || !v.isGroup)) {
var p = v.parent, d = p === i, g = cr(v), y = cr(p);
g.width = W(g.option.width, d ? s : y.width) || 0, g.height = W(g.option.height, d ? l : y.height) || 0;
}
}
for (var h = a.length - 1; h >= 0; h--) {
var f = a[h], c = oe(f.id, null), v = c != null ? o.get(c) : null;
if (v) {
var p = v.parent, y = cr(p), m = p === i ? {
width: s,
height: l
} : {
width: y.width,
height: y.height
}, _ = {}, S = ec(v, f, m, null, {
hv: f.hv,
boundingMode: f.bounding
}, _);
if (!cr(v).isNew && S) {
for (var x = f.transition, b = {}, w = 0; w < u.length; w++) {
var T = u[w], C = _[T];
x && (yi(x) || pt(x, T) >= 0) ? b[T] = C : v[T] = C;
}
Ct(v, b, t, 0);
} else
v.attr(_);
}
}
}, e.prototype._clear = function() {
var t = this, n = this._elMap;
n.each(function(a) {
wh(a, cr(a).option, n, t._lastGraphicModel);
}), this._elMap = X();
}, e.prototype.dispose = function() {
this._clear();
}, e.type = "graphic", e;
}(Yt)
);
function Cg(r) {
process.env.NODE_ENV !== "production" && tt(r, "graphic type MUST be set");
var e = Z(Kb, r) ? Kb[r] : xy(r);
process.env.NODE_ENV !== "production" && tt(e, "graphic type " + r + " can not be found");
var t = new e({});
return cr(t).type = r, t;
}
function jb(r, e, t, n) {
var a = Cg(t);
return e.add(a), n.set(r, a), cr(a).id = r, cr(a).isNew = !0, a;
}
function wh(r, e, t, n) {
var a = r && r.parent;
a && (r.type === "group" && r.traverse(function(i) {
wh(i, e, t, n);
}), yc(r, e, n), t.removeKey(cr(r).id));
}
function Qb(r, e, t, n) {
r.isGroup || A([
["cursor", Sr.prototype.cursor],
// We should not support configure z and zlevel in the element level.
// But seems we didn't limit it previously. So here still use it to avoid breaking.
["zlevel", n || 0],
["z", t || 0],
// z2 must not be null/undefined, otherwise sort error may occur.
["z2", 0]
], function(a) {
var i = a[0];
Z(e, i) ? r[i] = ot(e[i], a[1]) : r[i] == null && (r[i] = a[1]);
}), A(St(e), function(a) {
if (a.indexOf("on") === 0) {
var i = e[a];
r[a] = K(i) ? i : null;
}
}), Z(e, "draggable") && (r.draggable = e.draggable), e.name != null && (r.name = e.name), e.id != null && (r.id = e.id);
}
function b7(r) {
return r = B({}, r), A(["id", "parentId", "$action", "hv", "bounding", "textContent", "clipPath"].concat(wD), function(e) {
delete r[e];
}), r;
}
function w7(r, e, t) {
var n = it(r).eventData;
!r.silent && !r.ignore && !n && (n = it(r).eventData = {
componentType: "graphic",
componentIndex: e.componentIndex,
name: r.name
}), n && (n.info = t.info);
}
function T7(r) {
r.registerComponentModel(S7), r.registerComponentView(x7), r.registerPreprocessor(function(e) {
var t = e.graphic;
z(t) ? !t[0] || !t[0].elements ? e.graphic = [{
elements: t
}] : e.graphic = [e.graphic[0]] : t && !t.elements && (e.graphic = [{
elements: [t]
}]);
});
}
var Jb = ["x", "y", "radius", "angle", "single"], C7 = ["cartesian2d", "polar", "singleAxis"];
function D7(r) {
var e = r.get("coordinateSystem");
return pt(C7, e) >= 0;
}
function ia(r) {
return process.env.NODE_ENV !== "production" && tt(r), r + "Axis";
}
function A7(r, e) {
var t = X(), n = [], a = X();
r.eachComponent({
mainType: "dataZoom",
query: e
}, function(h) {
a.get(h.uid) || s(h);
});
var i;
do
i = !1, r.eachComponent("dataZoom", o);
while (i);
function o(h) {
!a.get(h.uid) && l(h) && (s(h), i = !0);
}
function s(h) {
a.set(h.uid, !0), n.push(h), u(h);
}
function l(h) {
var f = !1;
return h.eachTargetAxis(function(c, v) {
var p = t.get(c);
p && p[v] && (f = !0);
}), f;
}
function u(h) {
h.eachTargetAxis(function(f, c) {
(t.get(f) || t.set(f, []))[c] = !0;
});
}
return n;
}
function kI(r) {
var e = r.ecModel, t = {
infoList: [],
infoMap: X()
};
return r.eachTargetAxis(function(n, a) {
var i = e.getComponent(ia(n), a);
if (i) {
var o = i.getCoordSysModel();
if (o) {
var s = o.uid, l = t.infoMap.get(s);
l || (l = {
model: o,
axisModels: []
}, t.infoList.push(l), t.infoMap.set(s, l)), l.axisModels.push(i);
}
}
}), t;
}
var Ip = (
/** @class */
function() {
function r() {
this.indexList = [], this.indexMap = [];
}
return r.prototype.add = function(e) {
this.indexMap[e] || (this.indexList.push(e), this.indexMap[e] = !0);
}, r;
}()
), Il = (
/** @class */
function(r) {
O(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t.type = e.type, t._autoThrottle = !0, t._noTarget = !0, t._rangePropMode = ["percent", "percent"], t;
}
return e.prototype.init = function(t, n, a) {
var i = tw(t);
this.settledOption = i, this.mergeDefaultAndTheme(t, a), this._doInit(i);
}, e.prototype.mergeOption = function(t) {
var n = tw(t);
ht(this.option, t, !0), ht(this.settledOption, n, !0), this._doInit(n);
}, e.prototype._doInit = function(t) {
var n = this.option;
this._setDefaultThrottle(t), this._updateRangeUse(t);
var a = this.settledOption;
A([["start", "startValue"], ["end", "endValue"]], function(i, o) {
this._rangePropMode[o] === "value" && (n[i[0]] = a[i[0]] = null);
}, this), this._resetTarget();
}, e.prototype._resetTarget = function() {
var t = this.get("orient", !0), n = this._targetAxisInfoMap = X(), a = this._fillSpecifiedTargetAxis(n);
a ? this._orient = t || this._makeAutoOrientByTargetAxis() : (this._orient = t || "horizontal", this._fillAutoTargetAxisByOrient(n, this._orient)), this._noTarget = !0, n.each(function(i) {
i.indexList.length && (this._noTarget = !1);
}, this);
}, e.prototype._fillSpecifiedTargetAxis = function(t) {
var n = !1;
return A(Jb, function(a) {
var i = this.getReferringComponents(ia(a), gk);
if (i.specified) {
n = !0;
var o = new Ip();
A(i.models, function(s) {
o.add(s.componentIndex);
}), t.set(a, o);
}
}, this), n;
}, e.prototype._fillAutoTargetAxisByOrient = function(t, n) {
var a = this.ecModel, i = !0;
if (i) {
var o = n === "vertical" ? "y" : "x", s = a.findComponents({
mainType: o + "Axis"
});
l(s, o);
}
if (i) {
var s = a.findComponents({
mainType: "singleAxis",
filter: function(h) {
return h.get("orient", !0) === n;
}
});
l(s, "single");
}
function l(u, h) {
var f = u[0];
if (f) {
var c = new Ip();
if (c.add(f.componentIndex), t.set(h, c), i = !1, h === "x" || h === "y") {
var v = f.getReferringComponents("grid", ne).models[0];
v && A(u, function(p) {
f.componentIndex !== p.componentIndex && v === p.getReferringComponents("grid", ne).models[0] && c.add(p.componentIndex);
});
}
}
}
i && A(Jb, function(u) {
if (i) {
var h = a.findComponents({
mainType: ia(u),
filter: function(c) {
return c.get("type", !0) === "category";
}
});
if (h[0]) {
var f = new Ip();
f.add(h[0].componentIndex), t.set(u, f), i = !1;
}
}
}, this);
}, e.prototype._makeAutoOrientByTargetAxis = function() {
var t;
return this.eachTargetAxis(function(n) {
!t && (t = n);
}, this), t === "y" ? "vertical" : "horizontal";
}, e.prototype._setDefaultThrottle = function(t) {
if (t.hasOwnProperty("throttle") && (this._autoThrottle = !1), this._autoThrottle) {
var n = this.ecModel.option;
this.option.throttle = n.animation && n.animationDurationUpdate > 0 ? 100 : 20;
}
}, e.prototype._updateRangeUse = function(t) {
var n = this._rangePropMode, a = this.get("rangeMode");
A([["start", "startValue"], ["end", "endValue"]], function(i, o) {
var s = t[i[0]] != null, l = t[i[1]] != null;
s && !l ? n[o] = "percent" : !s && l ? n[o] = "value" : a ? n[o] = a[o] : s && (n[o] = "percent");
});
}, e.prototype.noTarget = function() {
return this._noTarget;
}, e.prototype.getFirstTargetAxisModel = function() {
var t;
return this.eachTargetAxis(function(n, a) {
t == null && (t = this.ecModel.getComponent(ia(n), a));
}, this), t;
}, e.prototype.eachTargetAxis = function(t, n) {
this._targetAxisInfoMap.each(function(a, i) {
A(a.indexList, function(o) {
t.call(n, i, o);
});
});
}, e.prototype.getAxisProxy = function(t, n) {
var a = this.getAxisModel(t, n);
if (a)
return a.__dzAxisProxy;
}, e.prototype.getAxisModel = function(t, n) {
process.env.NODE_ENV !== "production" && tt(t && n != null);
var a = this._targetAxisInfoMap.get(t);
if (a && a.indexMap[n])
return this.ecModel.getComponent(ia(t), n);
}, e.prototype.setRawRange = function(t) {
var n = this.option, a = this.settledOption;
A([["start", "startValue"], ["end", "endValue"]], function(i) {
(t[i[0]] != null || t[i[1]] != null) && (n[i[0]] = a[i[0]] = t[i[0]], n[i[1]] = a[i[1]] = t[i[1]]);
}, this), this._updateRangeUse(t);
}, e.prototype.setCalculatedRange = function(t) {
var n = this.option;
A(["start", "startValue", "end", "endValue"], function(a) {
n[a] = t[a];
});
}, e.prototype.getPercentRange = function() {
var t = this.findRepresentativeAxisProxy();
if (t)
return t.getDataPercentWindow();
}, e.prototype.getValueRange = function(t, n) {
if (t == null && n == null) {
var a = this.findRepresentativeAxisProxy();
if (a)
return a.getDataValueWindow();
} else
return this.getAxisProxy(t, n).getDataValueWindow();
}, e.prototype.findRepresentativeAxisProxy = function(t) {
if (t)
return t.__dzAxisProxy;
for (var n, a = this._targetAxisInfoMap.keys(), i = 0; i < a.length; i++)
for (var o = a[i], s = this._targetAxisInfoMap.get(o), l = 0; l < s.indexList.length; l++) {
var u = this.getAxisProxy(o, s.indexList[l]);
if (u.hostedBy(this))
return u;
n || (n = u);
}
return n;
}, e.prototype.getRangePropMode = function() {
return this._rangePropMode.slice();
}, e.prototype.getOrient = function() {
return process.env.NODE_ENV !== "production" && tt(this._orient), this._orient;
}, e.type = "dataZoom", e.dependencies = ["xAxis", "yAxis", "radiusAxis", "angleAxis", "singleAxis", "series", "toolbox"], e.defaultOption = {
// zlevel: 0,
z: 4,
filterMode: "filter",
start: 0,
end: 100
}, e;
}(_t)
);
function tw(r) {
var e = {};
return A(["start", "end", "startValue", "endValue", "throttle"], function(t) {
r.hasOwnProperty(t) && (e[t] = r[t]);
}), e;
}
var M7 = (
/** @class */
function(r) {
O(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t.type = e.type, t;
}
return e.type = "dataZoom.select", e;
}(Il)
), $m = (
/** @class */
function(r) {
O(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t.type = e.type, t;
}
return e.prototype.render = function(t, n, a, i) {
this.dataZoomModel = t, this.ecModel = n, this.api = a;
}, e.type = "dataZoom", e;
}(Yt)
), I7 = (
/** @class */
function(r) {
O(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t.type = e.type, t;
}
return e.type = "dataZoom.select", e;
}($m)
), fo = A, ew = yr, L7 = (
/** @class */
function() {
function r(e, t, n, a) {
this._dimName = e, this._axisIndex = t, this.ecModel = a, this._dataZoomModel = n;
}
return r.prototype.hostedBy = function(e) {
return this._dataZoomModel === e;
}, r.prototype.getDataValueWindow = function() {
return this._valueWindow.slice();
}, r.prototype.getDataPercentWindow = function() {
return this._percentWindow.slice();
}, r.prototype.getTargetSeriesModels = function() {
var e = [];
return this.ecModel.eachSeries(function(t) {
if (D7(t)) {
var n = ia(this._dimName), a = t.getReferringComponents(n, ne).models[0];
a && this._axisIndex === a.componentIndex && e.push(t);
}
}, this), e;
}, r.prototype.getAxisModel = function() {
return this.ecModel.getComponent(this._dimName + "Axis", this._axisIndex);
}, r.prototype.getMinMaxSpan = function() {
return nt(this._minMaxSpan);
}, r.prototype.calculateDataWindow = function(e) {
var t = this._dataExtent, n = this.getAxisModel(), a = n.axis.scale, i = this._dataZoomModel.getRangePropMode(), o = [0, 100], s = [], l = [], u;
fo(["start", "end"], function(c, v) {
var p = e[c], d = e[c + "Value"];
i[v] === "percent" ? (p == null && (p = o[v]), d = a.parse(Mt(p, o, t))) : (u = !0, d = d == null ? t[v] : a.parse(d), p = Mt(d, t, o)), l[v] = d == null || isNaN(d) ? t[v] : d, s[v] = p == null || isNaN(p) ? o[v] : p;
}), ew(l), ew(s);
var h = this._minMaxSpan;
u ? f(l, s, t, o, !1) : f(s, l, o, t, !0);
function f(c, v, p, d, g) {
var y = g ? "Span" : "ValueSpan";
Vi(0, c, p, "all", h["min" + y], h["max" + y]);
for (var m = 0; m < 2; m++)
v[m] = Mt(c[m], p, d, !0), g && (v[m] = a.parse(v[m]));
}
return {
valueWindow: l,
percentWindow: s
};
}, r.prototype.reset = function(e) {
if (e === this._dataZoomModel) {
var t = this.getTargetSeriesModels();
this._dataExtent = E7(this, this._dimName, t), this._updateMinMaxSpan();
var n = this.calculateDataWindow(e.settledOption);
this._valueWindow = n.valueWindow, this._percentWindow = n.percentWindow, this._setAxisModel();
}
}, r.prototype.filterData = function(e, t) {
if (e !== this._dataZoomModel)
return;
var n = this._dimName, a = this.getTargetSeriesModels(), i = e.get("filterMode"), o = this._valueWindow;
if (i === "none")
return;
fo(a, function(l) {
var u = l.getData(), h = u.mapDimensionsAll(n);
if (h.length) {
if (i === "weakFilter") {
var f = u.getStore(), c = G(h, function(v) {
return u.getDimensionIndex(v);
}, u);
u.filterSelf(function(v) {
for (var p, d, g, y = 0; y < h.length; y++) {
var m = f.get(c[y], v), _ = !isNaN(m), S = m < o[0], x = m > o[1];
if (_ && !S && !x)
return !0;
_ && (g = !0), S && (p = !0), x && (d = !0);
}
return g && p && d;
});
} else
fo(h, function(v) {
if (i === "empty")
l.setData(u = u.map(v, function(d) {
return s(d) ? d : NaN;
}));
else {
var p = {};
p[v] = o, u.selectRange(p);
}
});
fo(h, function(v) {
u.setApproximateExtent(o, v);
});
}
});
function s(l) {
return l >= o[0] && l <= o[1];
}
}, r.prototype._updateMinMaxSpan = function() {
var e = this._minMaxSpan = {}, t = this._dataZoomModel, n = this._dataExtent;
fo(["min", "max"], function(a) {
var i = t.get(a + "Span"), o = t.get(a + "ValueSpan");
o != null && (o = this.getAxisModel().axis.scale.parse(o)), o != null ? i = Mt(n[0] + o, n, [0, 100], !0) : i != null && (o = Mt(i, [0, 100], n, !0) - n[0]), e[a + "Span"] = i, e[a + "ValueSpan"] = o;
}, this);
}, r.prototype._setAxisModel = function() {
var e = this.getAxisModel(), t = this._percentWindow, n = this._valueWindow;
if (t) {
var a = vC(n, [0, 500]);
a = Math.min(a, 20);
var i = e.axis.scale.rawExtentInfo;
t[0] !== 0 && i.setDeterminedMinMax("min", +n[0].toFixed(a)), t[1] !== 100 && i.setDeterminedMinMax("max", +n[1].toFixed(a)), i.freeze();
}
}, r;
}()
);
function E7(r, e, t) {
var n = [1 / 0, -1 / 0];
fo(t, function(o) {
fz(n, o.getData(), e);
});
var a = r.getAxisModel(), i = KA(a.axis.scale, a, n).calculate();
return [i.min, i.max];
}
var P7 = {
// `dataZoomProcessor` will only be performed in needed series. Consider if
// there is a line series and a pie series, it is better not to update the
// line series if only pie series is needed to be updated.
getTargetSeries: function(r) {
function e(a) {
r.eachComponent("dataZoom", function(i) {
i.eachTargetAxis(function(o, s) {
var l = r.getComponent(ia(o), s);
a(o, s, l, i);
});
});
}
e(function(a, i, o, s) {
o.__dzAxisProxy = null;
});
var t = [];
e(function(a, i, o, s) {
o.__dzAxisProxy || (o.__dzAxisProxy = new L7(a, i, s, r), t.push(o.__dzAxisProxy));
});
var n = X();
return A(t, function(a) {
A(a.getTargetSeriesModels(), function(i) {
n.set(i.uid, i);
});
}), n;
},
// Consider appendData, where filter should be performed. Because data process is
// in block mode currently, it is not need to worry about that the overallProgress
// execute every frame.
overallReset: function(r, e) {
r.eachComponent("dataZoom", function(t) {
t.eachTargetAxis(function(n, a) {
t.getAxisProxy(n, a).reset(t);
}), t.eachTargetAxis(function(n, a) {
t.getAxisProxy(n, a).filterData(t, e);
});
}), r.eachComponent("dataZoom", function(t) {
var n = t.findRepresentativeAxisProxy();
if (n) {
var a = n.getDataPercentWindow(), i = n.getDataValueWindow();
t.setCalculatedRange({
start: a[0],
end: a[1],
startValue: i[0],
endValue: i[1]
});
}
});
}
};
function k7(r) {
r.registerAction("dataZoom", function(e, t) {
var n = A7(t, e);
A(n, function(a) {
a.setRawRange({
start: e.start,
end: e.end,
startValue: e.startValue,
endValue: e.endValue
});
});
});
}
var rw = !1;
function Um(r) {
rw || (rw = !0, r.registerProcessor(r.PRIORITY.PROCESSOR.FILTER, P7), k7(r), r.registerSubTypeDefaulter("dataZoom", function() {
return "slider";
}));
}
function R7(r) {
r.registerComponentModel(M7), r.registerComponentView(I7), Um(r);
}
var pr = (
/** @class */
/* @__PURE__ */ function() {
function r() {
}
return r;
}()
), RI = {};
function co(r, e) {
RI[r] = e;
}
function NI(r) {
return RI[r];
}
var N7 = (
/** @class */
function(r) {
O(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t.type = e.type, t;
}
return e.prototype.optionUpdated = function() {
r.prototype.optionUpdated.apply(this, arguments);
var t = this.ecModel;
A(this.option.feature, function(n, a) {
var i = NI(a);
i && (i.getDefaultOption && (i.defaultOption = i.getDefaultOption(t)), ht(n, i.defaultOption));
});
}, e.type = "toolbox", e.layoutMode = {
type: "box",
ignoreSize: !0
}, e.defaultOption = {
show: !0,
z: 6,
// zlevel: 0,
orient: "horizontal",
left: "right",
top: "top",
// right
// bottom
backgroundColor: "transparent",
borderColor: "#ccc",
borderRadius: 0,
borderWidth: 0,
padding: 5,
itemSize: 15,
itemGap: 8,
showTitle: !0,
iconStyle: {
borderColor: "#666",
color: "none"
},
emphasis: {
iconStyle: {
borderColor: "#3E98C5"
}
},
// textStyle: {},
// feature
tooltip: {
show: !1,
position: "bottom"
}
}, e;
}(_t)
);
function O7(r, e, t) {
var n = e.getBoxLayoutParams(), a = e.get("padding"), i = {
width: t.getWidth(),
height: t.getHeight()
}, o = se(n, i, a);
di(e.get("orient"), r, e.get("itemGap"), o.width, o.height), ec(r, n, i, a);
}
function OI(r, e) {
var t = Wo(e.get("padding")), n = e.getItemStyle(["color", "opacity"]);
return n.fill = e.get("backgroundColor"), r = new xt({
shape: {
x: r.x - t[3],
y: r.y - t[0],
width: r.width + t[1] + t[3],
height: r.height + t[0] + t[2],
r: e.get("borderRadius")
},
style: n,
silent: !0,
z2: -1
}), r;
}
var V7 = (
/** @class */
function(r) {
O(e, r);
function e() {
return r !== null && r.apply(this, arguments) || this;
}
return e.prototype.render = function(t, n, a, i) {
var o = this.group;
if (o.removeAll(), !t.get("show"))
return;
var s = +t.get("itemSize"), l = t.get("orient") === "vertical", u = t.get("feature") || {}, h = this._features || (this._features = {}), f = [];
A(u, function(p, d) {
f.push(d);
}), new Ln(this._featureNames || [], f).add(c).update(c).remove(ut(c, null)).execute(), this._featureNames = f;
function c(p, d) {
var g = f[p], y = f[d], m = u[g], _ = new It(m, t, t.ecModel), S;
if (i && i.newTitle != null && i.featureName === g && (m.title = i.newTitle), g && !y) {
if (B7(g))
S = {
onclick: _.option.onclick,
featureName: g
};
else {
var x = NI(g);
if (!x)
return;
S = new x();
}
h[g] = S;
} else if (S = h[y], !S)
return;
S.uid = Ho("toolbox-feature"), S.model = _, S.ecModel = n, S.api = a;
var b = S instanceof pr;
if (!g && y) {
b && S.dispose && S.dispose(n, a);
return;
}
if (!_.get("show") || b && S.unusable) {
b && S.remove && S.remove(n, a);
return;
}
v(_, S, g), _.setIconStatus = function(w, T) {
var C = this.option, D = this.iconPaths;
C.iconStatus = C.iconStatus || {}, C.iconStatus[w] = T, D[w] && (T === "emphasis" ? Mn : In)(D[w]);
}, S instanceof pr && S.render && S.render(_, n, a, i);
}
function v(p, d, g) {
var y = p.getModel("iconStyle"), m = p.getModel(["emphasis", "iconStyle"]), _ = d instanceof pr && d.getIcons ? d.getIcons() : p.get("icon"), S = p.get("title") || {}, x, b;
U(_) ? (x = {}, x[g] = _) : x = _, U(S) ? (b = {}, b[g] = S) : b = S;
var w = p.iconPaths = {};
A(x, function(T, C) {
var D = Hl(T, {}, {
x: -s / 2,
y: -s / 2,
width: s,
height: s
});
D.setStyle(y.getItemStyle());
var M = D.ensureState("emphasis");
M.style = m.getItemStyle();
var I = new wt({
style: {
text: b[C],
align: m.get("textAlign"),
borderRadius: m.get("textBorderRadius"),
padding: m.get("textPadding"),
fill: null,
font: by({
fontStyle: m.get("textFontStyle"),
fontFamily: m.get("textFontFamily"),
fontSize: m.get("textFontSize"),
fontWeight: m.get("textFontWeight")
}, n)
},
ignore: !0
});
D.setTextContent(I), Ei({
el: D,
componentModel: t,
itemName: C,
formatterParamsExtra: {
title: b[C]
}
}), D.__title = b[C], D.on("mouseover", function() {
var L = m.getItemStyle(), E = l ? t.get("right") == null && t.get("left") !== "right" ? "right" : "left" : t.get("bottom") == null && t.get("top") !== "bottom" ? "bottom" : "top";
I.setStyle({
fill: m.get("textFill") || L.fill || L.stroke || "#000",
backgroundColor: m.get("textBackgroundColor")
}), D.setTextConfig({
position: m.get("textPosition") || E
}), I.ignore = !t.get("showTitle"), a.enterEmphasis(this);
}).on("mouseout", function() {
p.get(["iconStatus", C]) !== "emphasis" && a.leaveEmphasis(this), I.hide();
}), (p.get(["iconStatus", C]) === "emphasis" ? Mn : In)(D), o.add(D), D.on("click", Y(d.onclick, d, n, a, C)), w[C] = D;
});
}
O7(o, t, a), o.add(OI(o.getBoundingRect(), t)), l || o.eachChild(function(p) {
var d = p.__title, g = p.ensureState("emphasis"), y = g.textConfig || (g.textConfig = {}), m = p.getTextContent(), _ = m && m.ensureState("emphasis");
if (_ && !K(_) && d) {
var S = _.style || (_.style = {}), x = Nl(d, wt.makeFont(S)), b = p.x + o.x, w = p.y + o.y + s, T = !1;
w + x.height > a.getHeight() && (y.position = "top", T = !0);
var C = T ? -5 - x.height : s + 10;
b + x.width / 2 > a.getWidth() ? (y.position = ["100%", C], S.align = "right") : b - x.width / 2 < 0 && (y.position = [0, C], S.align = "left");
}
});
}, e.prototype.updateView = function(t, n, a, i) {
A(this._features, function(o) {
o instanceof pr && o.updateView && o.updateView(o.model, n, a, i);
});
}, e.prototype.remove = function(t, n) {
A(this._features, function(a) {
a instanceof pr && a.remove && a.remove(t, n);
}), this.group.removeAll();
}, e.prototype.dispose = function(t, n) {
A(this._features, function(a) {
a instanceof pr && a.dispose && a.dispose(t, n);
});
}, e.type = "toolbox", e;
}(Yt)
);
function B7(r) {
return r.indexOf("my") === 0;
}
var z7 = (
/** @class */
function(r) {
O(e, r);
function e() {
return r !== null && r.apply(this, arguments) || this;
}
return e.prototype.onclick = function(t, n) {
var a = this.model, i = a.get("name") || t.get("title.0.text") || "echarts", o = n.getZr().painter.getType() === "svg", s = o ? "svg" : a.get("type", !0) || "png", l = n.getConnectedDataURL({
type: s,
backgroundColor: a.get("backgroundColor", !0) || t.get("backgroundColor") || "#fff",
connectedBackgroundColor: a.get("connectedBackgroundColor"),
excludeComponents: a.get("excludeComponents"),
pixelRatio: a.get("pixelRatio")
}), u = yt.browser;
if (typeof MouseEvent == "function" && (u.newEdge || !u.ie && !u.edge)) {
var h = document.createElement("a");
h.download = i + "." + s, h.target = "_blank", h.href = l;
var f = new MouseEvent("click", {
// some micro front-end framework, window maybe is a Proxy
view: document.defaultView,
bubbles: !0,
cancelable: !1
});
h.dispatchEvent(f);
} else if (window.navigator.msSaveOrOpenBlob || o) {
var c = l.split(","), v = c[0].indexOf("base64") > -1, p = o ? decodeURIComponent(c[1]) : c[1];
v && (p = window.atob(p));
var d = i + "." + s;
if (window.navigator.msSaveOrOpenBlob) {
for (var g = p.length, y = new Uint8Array(g); g--; )
y[g] = p.charCodeAt(g);
var m = new Blob([y]);
window.navigator.msSaveOrOpenBlob(m, d);
} else {
var _ = document.createElement("iframe");
document.body.appendChild(_);
var S = _.contentWindow, x = S.document;
x.open("image/svg+xml", "replace"), x.write(p), x.close(), S.focus(), x.execCommand("SaveAs", !0, d), document.body.removeChild(_);
}
} else {
var b = a.get("lang"), w = '<body style="margin:0;"><img src="' + l + '" style="max-width:100%;" title="' + (b && b[0] || "") + '" /></body>', T = window.open();
T.document.write(w), T.document.title = i;
}
}, e.getDefaultOption = function(t) {
var n = {
show: !0,
icon: "M4.7,22.9L29.3,45.5L54.7,23.4M4.6,43.6L4.6,58L53.8,58L53.8,43.6M29.2,45.1L29.2,0",
title: t.getLocaleModel().get(["toolbox", "saveAsImage", "title"]),
type: "png",
// Default use option.backgroundColor
// backgroundColor: '#fff',
connectedBackgroundColor: "#fff",
name: "",
excludeComponents: ["toolbox"],
// use current pixel ratio of device by default
// pixelRatio: 1,
lang: t.getLocaleModel().get(["toolbox", "saveAsImage", "lang"])
};
return n;
}, e;
}(pr)
), nw = "__ec_magicType_stack__", G7 = [["line", "bar"], ["stack"]], F7 = (
/** @class */
function(r) {
O(e, r);
function e() {
return r !== null && r.apply(this, arguments) || this;
}
return e.prototype.getIcons = function() {
var t = this.model, n = t.get("icon"), a = {};
return A(t.get("type"), function(i) {
n[i] && (a[i] = n[i]);
}), a;
}, e.getDefaultOption = function(t) {
var n = {
show: !0,
type: [],
// Icon group
icon: {
line: "M4.1,28.9h7.1l9.3-22l7.4,38l9.7-19.7l3,12.8h14.9M4.1,58h51.4",
bar: "M6.7,22.9h10V48h-10V22.9zM24.9,13h10v35h-10V13zM43.2,2h10v46h-10V2zM3.1,58h53.7",
// eslint-disable-next-line
stack: "M8.2,38.4l-8.4,4.1l30.6,15.3L60,42.5l-8.1-4.1l-21.5,11L8.2,38.4z M51.9,30l-8.1,4.2l-13.4,6.9l-13.9-6.9L8.2,30l-8.4,4.2l8.4,4.2l22.2,11l21.5-11l8.1-4.2L51.9,30z M51.9,21.7l-8.1,4.2L35.7,30l-5.3,2.8L24.9,30l-8.4-4.1l-8.3-4.2l-8.4,4.2L8.2,30l8.3,4.2l13.9,6.9l13.4-6.9l8.1-4.2l8.1-4.1L51.9,21.7zM30.4,2.2L-0.2,17.5l8.4,4.1l8.3,4.2l8.4,4.2l5.5,2.7l5.3-2.7l8.1-4.2l8.1-4.2l8.1-4.1L30.4,2.2z"
// jshint ignore:line
},
// `line`, `bar`, `stack`, `tiled`
title: t.getLocaleModel().get(["toolbox", "magicType", "title"]),
option: {},
seriesIndex: {}
};
return n;
}, e.prototype.onclick = function(t, n, a) {
var i = this.model, o = i.get(["seriesIndex", a]);
if (aw[a]) {
var s = {
series: []
}, l = function(f) {
var c = f.subType, v = f.id, p = aw[a](c, v, f, i);
p && (et(p, f.option), s.series.push(p));
var d = f.coordinateSystem;
if (d && d.type === "cartesian2d" && (a === "line" || a === "bar")) {
var g = d.getAxesByScale("ordinal")[0];
if (g) {
var y = g.dim, m = y + "Axis", _ = f.getReferringComponents(m, ne).models[0], S = _.componentIndex;
s[m] = s[m] || [];
for (var x = 0; x <= S; x++)
s[m][S] = s[m][S] || {};
s[m][S].boundaryGap = a === "bar";
}
}
};
A(G7, function(f) {
pt(f, a) >= 0 && A(f, function(c) {
i.setIconStatus(c, "normal");
});
}), i.setIconStatus(a, "emphasis"), t.eachComponent({
mainType: "series",
query: o == null ? null : {
seriesIndex: o
}
}, l);
var u, h = a;
a === "stack" && (u = ht({
stack: i.option.title.tiled,
tiled: i.option.title.stack
}, i.option.title), i.get(["iconStatus", a]) !== "emphasis" && (h = "tiled")), n.dispatchAction({
type: "changeMagicType",
currentType: h,
newOption: s,
newTitle: u,
featureName: "magicType"
});
}
}, e;
}(pr)
), aw = {
line: function(r, e, t, n) {
if (r === "bar")
return ht({
id: e,
type: "line",
// Preserve data related option
data: t.get("data"),
stack: t.get("stack"),
markPoint: t.get("markPoint"),
markLine: t.get("markLine")
}, n.get(["option", "line"]) || {}, !0);
},
bar: function(r, e, t, n) {
if (r === "line")
return ht({
id: e,
type: "bar",
// Preserve data related option
data: t.get("data"),
stack: t.get("stack"),
markPoint: t.get("markPoint"),
markLine: t.get("markLine")
}, n.get(["option", "bar"]) || {}, !0);
},
stack: function(r, e, t, n) {
var a = t.get("stack") === nw;
if (r === "line" || r === "bar")
return n.setIconStatus("stack", a ? "normal" : "emphasis"), ht({
id: e,
stack: a ? "" : nw
}, n.get(["option", "stack"]) || {}, !0);
}
};
un({
type: "changeMagicType",
event: "magicTypeChanged",
update: "prepareAndUpdate"
}, function(r, e) {
e.mergeOption(r.newOption);
});
var mc = new Array(60).join("-"), Ro = " ";
function H7(r) {
var e = {}, t = [], n = [];
return r.eachRawSeries(function(a) {
var i = a.coordinateSystem;
if (i && (i.type === "cartesian2d" || i.type === "polar")) {
var o = i.getBaseAxis();
if (o.type === "category") {
var s = o.dim + "_" + o.index;
e[s] || (e[s] = {
categoryAxis: o,
valueAxis: i.getOtherAxis(o),
series: []
}, n.push({
axisDim: o.dim,
axisIndex: o.index
})), e[s].series.push(a);
} else
t.push(a);
} else
t.push(a);
}), {
seriesGroupByCategoryAxis: e,
other: t,
meta: n
};
}
function W7(r) {
var e = [];
return A(r, function(t, n) {
var a = t.categoryAxis, i = t.valueAxis, o = i.dim, s = [" "].concat(G(t.series, function(v) {
return v.name;
})), l = [a.model.getCategories()];
A(t.series, function(v) {
var p = v.getRawData();
l.push(v.getRawData().mapArray(p.mapDimension(o), function(d) {
return d;
}));
});
for (var u = [s.join(Ro)], h = 0; h < l[0].length; h++) {
for (var f = [], c = 0; c < l.length; c++)
f.push(l[c][h]);
u.push(f.join(Ro));
}
e.push(u.join(`
`));
}), e.join(`
` + mc + `
`);
}
function $7(r) {
return G(r, function(e) {
var t = e.getRawData(), n = [e.name], a = [];
return t.each(t.dimensions, function() {
for (var i = arguments.length, o = arguments[i - 1], s = t.getName(o), l = 0; l < i - 1; l++)
a[l] = arguments[l];
n.push((s ? s + Ro : "") + a.join(Ro));
}), n.join(`
`);
}).join(`
` + mc + `
`);
}
function U7(r) {
var e = H7(r);
return {
value: At([W7(e.seriesGroupByCategoryAxis), $7(e.other)], function(t) {
return !!t.replace(/[\n\t\s]/g, "");
}).join(`
` + mc + `
`),
meta: e.meta
};
}
function _f(r) {
return r.replace(/^\s\s*/, "").replace(/\s\s*$/, "");
}
function Y7(r) {
var e = r.slice(0, r.indexOf(`
`));
if (e.indexOf(Ro) >= 0)
return !0;
}
var Dg = new RegExp("[" + Ro + "]+", "g");
function Z7(r) {
for (var e = r.split(/\n+/g), t = _f(e.shift()).split(Dg), n = [], a = G(t, function(l) {
return {
name: l,
data: []
};
}), i = 0; i < e.length; i++) {
var o = _f(e[i]).split(Dg);
n.push(o.shift());
for (var s = 0; s < o.length; s++)
a[s] && (a[s].data[i] = o[s]);
}
return {
series: a,
categories: n
};
}
function X7(r) {
for (var e = r.split(/\n+/g), t = _f(e.shift()), n = [], a = 0; a < e.length; a++) {
var i = _f(e[a]);
if (i) {
var o = i.split(Dg), s = "", l = void 0, u = !1;
isNaN(o[0]) ? (u = !0, s = o[0], o = o.slice(1), n[a] = {
name: s,
value: []
}, l = n[a].value) : l = n[a] = [];
for (var h = 0; h < o.length; h++)
l.push(+o[h]);
l.length === 1 && (u ? n[a].value = l[0] : n[a] = l[0]);
}
}
return {
name: t,
data: n
};
}
function q7(r, e) {
var t = r.split(new RegExp(`
*` + mc + `
*`, "g")), n = {
series: []
};
return A(t, function(a, i) {
if (Y7(a)) {
var o = Z7(a), s = e[i], l = s.axisDim + "Axis";
s && (n[l] = n[l] || [], n[l][s.axisIndex] = {
data: o.categories
}, n.series = n.series.concat(o.series));
} else {
var o = X7(a);
n.series.push(o);
}
}), n;
}
var K7 = (
/** @class */
function(r) {
O(e, r);
function e() {
return r !== null && r.apply(this, arguments) || this;
}
return e.prototype.onclick = function(t, n) {
setTimeout(function() {
n.dispatchAction({
type: "hideTip"
});
});
var a = n.getDom(), i = this.model;
this._dom && a.removeChild(this._dom);
var o = document.createElement("div");
o.style.cssText = "position:absolute;top:0;bottom:0;left:0;right:0;padding:5px", o.style.backgroundColor = i.get("backgroundColor") || "#fff";
var s = document.createElement("h4"), l = i.get("lang") || [];
s.innerHTML = l[0] || i.get("title"), s.style.cssText = "margin:10px 20px", s.style.color = i.get("textColor");
var u = document.createElement("div"), h = document.createElement("textarea");
u.style.cssText = "overflow:auto";
var f = i.get("optionToContent"), c = i.get("contentToOption"), v = U7(t);
if (K(f)) {
var p = f(n.getOption());
U(p) ? u.innerHTML = p : _i(p) && u.appendChild(p);
} else {
h.readOnly = i.get("readOnly");
var d = h.style;
d.cssText = "display:block;width:100%;height:100%;font-family:monospace;font-size:14px;line-height:1.6rem;resize:none;box-sizing:border-box;outline:none", d.color = i.get("textColor"), d.borderColor = i.get("textareaBorderColor"), d.backgroundColor = i.get("textareaColor"), h.value = v.value, u.appendChild(h);
}
var g = v.meta, y = document.createElement("div");
y.style.cssText = "position:absolute;bottom:5px;left:0;right:0";
var m = "float:right;margin-right:20px;border:none;cursor:pointer;padding:2px 5px;font-size:12px;border-radius:3px", _ = document.createElement("div"), S = document.createElement("div");
m += ";background-color:" + i.get("buttonColor"), m += ";color:" + i.get("buttonTextColor");
var x = this;
function b() {
a.removeChild(o), x._dom = null;
}
nd(_, "click", b), nd(S, "click", function() {
if (c == null && f != null || c != null && f == null) {
process.env.NODE_ENV !== "production" && Zt("It seems you have just provided one of `contentToOption` and `optionToContent` functions but missed the other one. Data change is ignored."), b();
return;
}
var w;
try {
K(c) ? w = c(u, n.getOption()) : w = q7(h.value, g);
} catch (T) {
throw b(), new Error("Data view format error " + T);
}
w && n.dispatchAction({
type: "changeDataView",
newOption: w
}), b();
}), _.innerHTML = l[1], S.innerHTML = l[2], S.style.cssText = _.style.cssText = m, !i.get("readOnly") && y.appendChild(S), y.appendChild(_), o.appendChild(s), o.appendChild(u), o.appendChild(y), u.style.height = a.clientHeight - 80 + "px", a.appendChild(o), this._dom = o;
}, e.prototype.remove = function(t, n) {
this._dom && n.getDom().removeChild(this._dom);
}, e.prototype.dispose = function(t, n) {
this.remove(t, n);
}, e.getDefaultOption = function(t) {
var n = {
show: !0,
readOnly: !1,
optionToContent: null,
contentToOption: null,
// eslint-disable-next-line
icon: "M17.5,17.3H33 M17.5,17.3H33 M45.4,29.5h-28 M11.5,2v56H51V14.8L38.4,2H11.5z M38.4,2.2v12.7H51 M45.4,41.7h-28",
title: t.getLocaleModel().get(["toolbox", "dataView", "title"]),
lang: t.getLocaleModel().get(["toolbox", "dataView", "lang"]),
backgroundColor: "#fff",
textColor: "#000",
textareaColor: "#fff",
textareaBorderColor: "#333",
buttonColor: "#c23531",
buttonTextColor: "#fff"
};
return n;
}, e;
}(pr)
);
function j7(r, e) {
return G(r, function(t, n) {
var a = e && e[n];
if (J(a) && !z(a)) {
var i = J(t) && !z(t);
i || (t = {
value: t
});
var o = a.name != null && t.name == null;
return t = et(t, a), o && delete t.name, t;
} else
return t;
});
}
un({
type: "changeDataView",
event: "dataViewChanged",
update: "prepareAndUpdate"
}, function(r, e) {
var t = [];
A(r.newOption.series, function(n) {
var a = e.getSeriesByName(n.name)[0];
if (!a)
t.push(B({
// Default is scatter
type: "scatter"
}, n));
else {
var i = a.get("data");
t.push({
name: n.name,
data: j7(n.data, i)
});
}
}), e.mergeOption(et({
series: t
}, r.newOption));
});
var VI = A, BI = bt();
function Q7(r, e) {
var t = Ym(r);
VI(e, function(n, a) {
for (var i = t.length - 1; i >= 0; i--) {
var o = t[i];
if (o[a])
break;
}
if (i < 0) {
var s = r.queryComponents({
mainType: "dataZoom",
subType: "select",
id: a
})[0];
if (s) {
var l = s.getPercentRange();
t[0][a] = {
dataZoomId: a,
start: l[0],
end: l[1]
};
}
}
}), t.push(e);
}
function J7(r) {
var e = Ym(r), t = e[e.length - 1];
e.length > 1 && e.pop();
var n = {};
return VI(t, function(a, i) {
for (var o = e.length - 1; o >= 0; o--)
if (a = e[o][i], a) {
n[i] = a;
break;
}
}), n;
}
function t$(r) {
BI(r).snapshots = null;
}
function e$(r) {
return Ym(r).length;
}
function Ym(r) {
var e = BI(r);
return e.snapshots || (e.snapshots = [{}]), e.snapshots;
}
var r$ = (
/** @class */
function(r) {
O(e, r);
function e() {
return r !== null && r.apply(this, arguments) || this;
}
return e.prototype.onclick = function(t, n) {
t$(t), n.dispatchAction({
type: "restore",
from: this.uid
});
}, e.getDefaultOption = function(t) {
var n = {
show: !0,
// eslint-disable-next-line
icon: "M3.8,33.4 M47,18.9h9.8V8.7 M56.3,20.1 C52.1,9,40.5,0.6,26.8,2.1C12.6,3.7,1.6,16.2,2.1,30.6 M13,41.1H3.1v10.2 M3.7,39.9c4.2,11.1,15.8,19.5,29.5,18 c14.2-1.6,25.2-14.1,24.7-28.5",
title: t.getLocaleModel().get(["toolbox", "restore", "title"])
};
return n;
}, e;
}(pr)
);
un({
type: "restore",
event: "restore",
update: "prepareAndUpdate"
}, function(r, e) {
e.resetOption("recreate");
});
var n$ = ["grid", "xAxis", "yAxis", "geo", "graph", "polar", "radiusAxis", "angleAxis", "bmap"], Zm = (
/** @class */
function() {
function r(e, t, n) {
var a = this;
this._targetInfoList = [];
var i = iw(t, e);
A(a$, function(o, s) {
(!n || !n.include || pt(n.include, s) >= 0) && o(i, a._targetInfoList);
});
}
return r.prototype.setOutputRanges = function(e, t) {
return this.matchOutputRanges(e, t, function(n, a, i) {
if ((n.coordRanges || (n.coordRanges = [])).push(a), !n.coordRange) {
n.coordRange = a;
var o = Lp[n.brushType](0, i, a);
n.__rangeOffset = {
offset: uw[n.brushType](o.values, n.range, [1, 1]),
xyMinMax: o.xyMinMax
};
}
}), e;
}, r.prototype.matchOutputRanges = function(e, t, n) {
A(e, function(a) {
var i = this.findTargetInfo(a, t);
i && i !== !0 && A(i.coordSyses, function(o) {
var s = Lp[a.brushType](1, o, a.range, !0);
n(a, s.values, o, t);
});
}, this);
}, r.prototype.setInputRanges = function(e, t) {
A(e, function(n) {
var a = this.findTargetInfo(n, t);
if (process.env.NODE_ENV !== "production" && (tt(!a || a === !0 || n.coordRange, "coordRange must be specified when coord index specified."), tt(!a || a !== !0 || n.range, "range must be specified in global brush.")), n.range = n.range || [], a && a !== !0) {
n.panelId = a.panelId;
var i = Lp[n.brushType](0, a.coordSys, n.coordRange), o = n.__rangeOffset;
n.range = o ? uw[n.brushType](i.values, o.offset, i$(i.xyMinMax, o.xyMinMax)) : i.values;
}
}, this);
}, r.prototype.makePanelOpts = function(e, t) {
return G(this._targetInfoList, function(n) {
var a = n.getPanelRect();
return {
panelId: n.panelId,
defaultBrushType: t ? t(n) : null,
clipPath: U2(a),
isTargetByCursor: Z2(a, e, n.coordSysModel),
getLinearBrushOtherExtent: Y2(a)
};
});
}, r.prototype.controlSeries = function(e, t, n) {
var a = this.findTargetInfo(e, n);
return a === !0 || a && pt(a.coordSyses, t.coordinateSystem) >= 0;
}, r.prototype.findTargetInfo = function(e, t) {
for (var n = this._targetInfoList, a = iw(t, e), i = 0; i < n.length; i++) {
var o = n[i], s = e.panelId;
if (s) {
if (o.panelId === s)
return o;
} else
for (var l = 0; l < ow.length; l++)
if (ow[l](a, o))
return o;
}
return !0;
}, r;
}()
);
function Ag(r) {
return r[0] > r[1] && r.reverse(), r;
}
function iw(r, e) {
return qs(r, e, {
includeMainTypes: n$
});
}
var a$ = {
grid: function(r, e) {
var t = r.xAxisModels, n = r.yAxisModels, a = r.gridModels, i = X(), o = {}, s = {};
!t && !n && !a || (A(t, function(l) {
var u = l.axis.grid.model;
i.set(u.id, u), o[u.id] = !0;
}), A(n, function(l) {
var u = l.axis.grid.model;
i.set(u.id, u), s[u.id] = !0;
}), A(a, function(l) {
i.set(l.id, l), o[l.id] = !0, s[l.id] = !0;
}), i.each(function(l) {
var u = l.coordinateSystem, h = [];
A(u.getCartesians(), function(f, c) {
(pt(t, f.getAxis("x").model) >= 0 || pt(n, f.getAxis("y").model) >= 0) && h.push(f);
}), e.push({
panelId: "grid--" + l.id,
gridModel: l,
coordSysModel: l,
// Use the first one as the representitive coordSys.
coordSys: h[0],
coordSyses: h,
getPanelRect: sw.grid,
xAxisDeclared: o[l.id],
yAxisDeclared: s[l.id]
});
}));
},
geo: function(r, e) {
A(r.geoModels, function(t) {
var n = t.coordinateSystem;
e.push({
panelId: "geo--" + t.id,
geoModel: t,
coordSysModel: t,
coordSys: n,
coordSyses: [n],
getPanelRect: sw.geo
});
});
}
}, ow = [
// grid
function(r, e) {
var t = r.xAxisModel, n = r.yAxisModel, a = r.gridModel;
return !a && t && (a = t.axis.grid.model), !a && n && (a = n.axis.grid.model), a && a === e.gridModel;
},
// geo
function(r, e) {
var t = r.geoModel;
return t && t === e.geoModel;
}
], sw = {
grid: function() {
return this.coordSys.master.getRect().clone();
},
geo: function() {
var r = this.coordSys, e = r.getBoundingRect().clone();
return e.applyTransform(pi(r)), e;
}
}, Lp = {
lineX: ut(lw, 0),
lineY: ut(lw, 1),
rect: function(r, e, t, n) {
var a = r ? e.pointToData([t[0][0], t[1][0]], n) : e.dataToPoint([t[0][0], t[1][0]], n), i = r ? e.pointToData([t[0][1], t[1][1]], n) : e.dataToPoint([t[0][1], t[1][1]], n), o = [Ag([a[0], i[0]]), Ag([a[1], i[1]])];
return {
values: o,
xyMinMax: o
};
},
polygon: function(r, e, t, n) {
var a = [[1 / 0, -1 / 0], [1 / 0, -1 / 0]], i = G(t, function(o) {
var s = r ? e.pointToData(o, n) : e.dataToPoint(o, n);
return a[0][0] = Math.min(a[0][0], s[0]), a[1][0] = Math.min(a[1][0], s[1]), a[0][1] = Math.max(a[0][1], s[0]), a[1][1] = Math.max(a[1][1], s[1]), s;
});
return {
values: i,
xyMinMax: a
};
}
};
function lw(r, e, t, n) {
process.env.NODE_ENV !== "production" && tt(t.type === "cartesian2d", "lineX/lineY brush is available only in cartesian2d.");
var a = t.getAxis(["x", "y"][r]), i = Ag(G([0, 1], function(s) {
return e ? a.coordToData(a.toLocalCoord(n[s]), !0) : a.toGlobalCoord(a.dataToCoord(n[s]));
})), o = [];
return o[r] = i, o[1 - r] = [NaN, NaN], {
values: i,
xyMinMax: o
};
}
var uw = {
lineX: ut(hw, 0),
lineY: ut(hw, 1),
rect: function(r, e, t) {
return [[r[0][0] - t[0] * e[0][0], r[0][1] - t[0] * e[0][1]], [r[1][0] - t[1] * e[1][0], r[1][1] - t[1] * e[1][1]]];
},
polygon: function(r, e, t) {
return G(r, function(n, a) {
return [n[0] - t[0] * e[a][0], n[1] - t[1] * e[a][1]];
});
}
};
function hw(r, e, t, n) {
return [e[0] - n[r] * t[0], e[1] - n[r] * t[1]];
}
function i$(r, e) {
var t = fw(r), n = fw(e), a = [t[0] / n[0], t[1] / n[1]];
return isNaN(a[0]) && (a[0] = 1), isNaN(a[1]) && (a[1] = 1), a;
}
function fw(r) {
return r ? [r[0][1] - r[0][0], r[1][1] - r[1][0]] : [NaN, NaN];
}
var Mg = A, o$ = fk("toolbox-dataZoom_"), s$ = (
/** @class */
function(r) {
O(e, r);
function e() {
return r !== null && r.apply(this, arguments) || this;
}
return e.prototype.render = function(t, n, a, i) {
this._brushController || (this._brushController = new Sm(a.getZr()), this._brushController.on("brush", Y(this._onBrush, this)).mount()), h$(t, n, this, i, a), u$(t, n);
}, e.prototype.onclick = function(t, n, a) {
l$[a].call(this);
}, e.prototype.remove = function(t, n) {
this._brushController && this._brushController.unmount();
}, e.prototype.dispose = function(t, n) {
this._brushController && this._brushController.dispose();
}, e.prototype._onBrush = function(t) {
var n = t.areas;
if (!t.isEnd || !n.length)
return;
var a = {}, i = this.ecModel;
this._brushController.updateCovers([]);
var o = new Zm(Xm(this.model), i, {
include: ["grid"]
});
o.matchOutputRanges(n, i, function(u, h, f) {
if (f.type === "cartesian2d") {
var c = u.brushType;
c === "rect" ? (s("x", f, h[0]), s("y", f, h[1])) : s({
lineX: "x",
lineY: "y"
}[c], f, h);
}
}), Q7(i, a), this._dispatchZoomAction(a);
function s(u, h, f) {
var c = h.getAxis(u), v = c.model, p = l(u, v, i), d = p.findRepresentativeAxisProxy(v).getMinMaxSpan();
(d.minValueSpan != null || d.maxValueSpan != null) && (f = Vi(0, f.slice(), c.scale.getExtent(), 0, d.minValueSpan, d.maxValueSpan)), p && (a[p.id] = {
dataZoomId: p.id,
startValue: f[0],
endValue: f[1]
});
}
function l(u, h, f) {
var c;
return f.eachComponent({
mainType: "dataZoom",
subType: "select"
}, function(v) {
var p = v.getAxisModel(u, h.componentIndex);
p && (c = v);
}), c;
}
}, e.prototype._dispatchZoomAction = function(t) {
var n = [];
Mg(t, function(a, i) {
n.push(nt(a));
}), n.length && this.api.dispatchAction({
type: "dataZoom",
from: this.uid,
batch: n
});
}, e.getDefaultOption = function(t) {
var n = {
show: !0,
filterMode: "filter",
// Icon group
icon: {
zoom: "M0,13.5h26.9 M13.5,26.9V0 M32.1,13.5H58V58H13.5 V32.1",
back: "M22,1.4L9.9,13.5l12.3,12.3 M10.3,13.5H54.9v44.6 H10.3v-26"
},
// `zoom`, `back`
title: t.getLocaleModel().get(["toolbox", "dataZoom", "title"]),
brushStyle: {
borderWidth: 0,
color: "rgba(210,219,238,0.2)"
}
};
return n;
}, e;
}(pr)
), l$ = {
zoom: function() {
var r = !this._isZoomActive;
this.api.dispatchAction({
type: "takeGlobalCursor",
key: "dataZoomSelect",
dataZoomSelectActive: r
});
},
back: function() {
this._dispatchZoomAction(J7(this.ecModel));
}
};
function Xm(r) {
var e = {
xAxisIndex: r.get("xAxisIndex", !0),
yAxisIndex: r.get("yAxisIndex", !0),
xAxisId: r.get("xAxisId", !0),
yAxisId: r.get("yAxisId", !0)
};
return e.xAxisIndex == null && e.xAxisId == null && (e.xAxisIndex = "all"), e.yAxisIndex == null && e.yAxisId == null && (e.yAxisIndex = "all"), e;
}
function u$(r, e) {
r.setIconStatus("back", e$(e) > 1 ? "emphasis" : "normal");
}
function h$(r, e, t, n, a) {
var i = t._isZoomActive;
n && n.type === "takeGlobalCursor" && (i = n.key === "dataZoomSelect" ? n.dataZoomSelectActive : !1), t._isZoomActive = i, r.setIconStatus("zoom", i ? "emphasis" : "normal");
var o = new Zm(Xm(r), e, {
include: ["grid"]
}), s = o.makePanelOpts(a, function(l) {
return l.xAxisDeclared && !l.yAxisDeclared ? "lineX" : !l.xAxisDeclared && l.yAxisDeclared ? "lineY" : "rect";
});
t._brushController.setPanels(s).enableBrush(i && s.length ? {
brushType: "auto",
brushStyle: r.getModel("brushStyle").getItemStyle()
} : !1);
}
ON("dataZoom", function(r) {
var e = r.getComponent("toolbox", 0), t = ["feature", "dataZoom"];
if (!e || e.get(t) == null)
return;
var n = e.getModel(t), a = [], i = Xm(n), o = qs(r, i);
Mg(o.xAxisModels, function(l) {
return s(l, "xAxis", "xAxisIndex");
}), Mg(o.yAxisModels, function(l) {
return s(l, "yAxis", "yAxisIndex");
});
function s(l, u, h) {
var f = l.componentIndex, c = {
type: "select",
$fromToolbox: !0,
// Default to be filter
filterMode: n.get("filterMode", !0) || "filter",
// Id for merge mapping.
id: o$ + u + f
};
c[h] = f, a.push(c);
}
return a;
});
function f$(r) {
r.registerComponentModel(N7), r.registerComponentView(V7), co("saveAsImage", z7), co("magicType", F7), co("dataView", K7), co("dataZoom", s$), co("restore", r$), gt(R7);
}
var c$ = (
/** @class */
function(r) {
O(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t.type = e.type, t;
}
return e.type = "tooltip", e.dependencies = ["axisPointer"], e.defaultOption = {
// zlevel: 0,
z: 60,
show: !0,
// tooltip main content
showContent: !0,
// 'trigger' only works on coordinate system.
// 'item' | 'axis' | 'none'
trigger: "item",
// 'click' | 'mousemove' | 'none'
triggerOn: "mousemove|click",
alwaysShowContent: !1,
displayMode: "single",
renderMode: "auto",
// whether restraint content inside viewRect.
// If renderMode: 'richText', default true.
// If renderMode: 'html', defaut false (for backward compat).
confine: null,
showDelay: 0,
hideDelay: 100,
// Animation transition time, unit is second
transitionDuration: 0.4,
enterable: !1,
backgroundColor: "#fff",
// box shadow
shadowBlur: 10,
shadowColor: "rgba(0, 0, 0, .2)",
shadowOffsetX: 1,
shadowOffsetY: 2,
// tooltip border radius, unit is px, default is 4
borderRadius: 4,
// tooltip border width, unit is px, default is 0 (no border)
borderWidth: 1,
// Tooltip inside padding, default is 5 for all direction
// Array is allowed to set up, right, bottom, left, same with css
// The default value: See `tooltip/tooltipMarkup.ts#getPaddingFromTooltipModel`.
padding: null,
// Extra css text
extraCssText: "",
// axis indicator, trigger by axis
axisPointer: {
// default is line
// legal values: 'line' | 'shadow' | 'cross'
type: "line",
// Valid when type is line, appoint tooltip line locate on which line. Optional
// legal values: 'x' | 'y' | 'angle' | 'radius' | 'auto'
// default is 'auto', chose the axis which type is category.
// for multiply y axis, cartesian coord chose x axis, polar chose angle axis
axis: "auto",
animation: "auto",
animationDurationUpdate: 200,
animationEasingUpdate: "exponentialOut",
crossStyle: {
color: "#999",
width: 1,
type: "dashed",
// TODO formatter
textStyle: {}
}
// lineStyle and shadowStyle should not be specified here,
// otherwise it will always override those styles on option.axisPointer.
},
textStyle: {
color: "#666",
fontSize: 14
}
}, e;
}(_t)
);
function zI(r) {
var e = r.get("confine");
return e != null ? !!e : r.get("renderMode") === "richText";
}
function GI(r) {
if (yt.domSupported) {
for (var e = document.documentElement.style, t = 0, n = r.length; t < n; t++)
if (r[t] in e)
return r[t];
}
}
var FI = GI(["transform", "webkitTransform", "OTransform", "MozTransform", "msTransform"]), v$ = GI(["webkitTransition", "transition", "OTransition", "MozTransition", "msTransition"]);
function HI(r, e) {
if (!r)
return e;
e = xD(e, !0);
var t = r.indexOf(e);
return r = t === -1 ? e : "-" + r.slice(0, t) + "-" + e, r.toLowerCase();
}
function p$(r, e) {
var t = r.currentStyle || document.defaultView && document.defaultView.getComputedStyle(r);
return t ? t[e] : null;
}
var d$ = HI(v$, "transition"), qm = HI(FI, "transform"), g$ = "position:absolute;display:block;border-style:solid;white-space:nowrap;z-index:9999999;" + (yt.transform3dSupported ? "will-change:transform;" : "");
function y$(r) {
return r = r === "left" ? "right" : r === "right" ? "left" : r === "top" ? "bottom" : "top", r;
}
function m$(r, e, t) {
if (!U(t) || t === "inside")
return "";
var n = r.get("backgroundColor"), a = r.get("borderWidth");
e = Ci(e);
var i = y$(t), o = Math.max(Math.round(a) * 1.5, 6), s = "", l = qm + ":", u;
pt(["left", "right"], i) > -1 ? (s += "top:50%", l += "translateY(-50%) rotate(" + (u = i === "left" ? -225 : -45) + "deg)") : (s += "left:50%", l += "translateX(-50%) rotate(" + (u = i === "top" ? 225 : 45) + "deg)");
var h = u * Math.PI / 180, f = o + a, c = f * Math.abs(Math.cos(h)) + f * Math.abs(Math.sin(h)), v = Math.round(((c - Math.SQRT2 * a) / 2 + Math.SQRT2 * a - (c - f) / 2) * 100) / 100;
s += ";" + i + ":-" + v + "px";
var p = e + " solid " + a + "px;", d = ["position:absolute;width:" + o + "px;height:" + o + "px;z-index:-1;", s + ";" + l + ";", "border-bottom:" + p, "border-right:" + p, "background-color:" + n + ";"];
return '<div style="' + d.join("") + '"></div>';
}
function _$(r, e) {
var t = "cubic-bezier(0.23,1,0.32,1)", n = " " + r / 2 + "s " + t, a = "opacity" + n + ",visibility" + n;
return e || (n = " " + r + "s " + t, a += yt.transformSupported ? "," + qm + n : ",left" + n + ",top" + n), d$ + ":" + a;
}
function cw(r, e, t) {
var n = r.toFixed(0) + "px", a = e.toFixed(0) + "px";
if (!yt.transformSupported)
return t ? "top:" + a + ";left:" + n + ";" : [["top", a], ["left", n]];
var i = yt.transform3dSupported, o = "translate" + (i ? "3d" : "") + "(" + n + "," + a + (i ? ",0" : "") + ")";
return t ? "top:0;left:0;" + qm + ":" + o + ";" : [["top", 0], ["left", 0], [FI, o]];
}
function S$(r) {
var e = [], t = r.get("fontSize"), n = r.getTextColor();
n && e.push("color:" + n), e.push("font:" + r.getFont());
var a = ot(r.get("lineHeight"), Math.round(t * 3 / 2));
t && e.push("line-height:" + a + "px");
var i = r.get("textShadowColor"), o = r.get("textShadowBlur") || 0, s = r.get("textShadowOffsetX") || 0, l = r.get("textShadowOffsetY") || 0;
return i && o && e.push("text-shadow:" + s + "px " + l + "px " + o + "px " + i), A(["decoration", "align"], function(u) {
var h = r.get(u);
h && e.push("text-" + u + ":" + h);
}), e.join(";");
}
function x$(r, e, t) {
var n = [], a = r.get("transitionDuration"), i = r.get("backgroundColor"), o = r.get("shadowBlur"), s = r.get("shadowColor"), l = r.get("shadowOffsetX"), u = r.get("shadowOffsetY"), h = r.getModel("textStyle"), f = tA(r, "html"), c = l + "px " + u + "px " + o + "px " + s;
return n.push("box-shadow:" + c), e && a && n.push(_$(a, t)), i && n.push("background-color:" + i), A(["width", "color", "radius"], function(v) {
var p = "border-" + v, d = xD(p), g = r.get(d);
g != null && n.push(p + ":" + g + (v === "color" ? "" : "px"));
}), n.push(S$(h)), f != null && n.push("padding:" + Wo(f).join("px ") + "px"), n.join(";") + ";";
}
function vw(r, e, t, n, a) {
var i = e && e.painter;
if (t) {
var o = i && i.getViewportRoot();
o && BE(r, o, t, n, a);
} else {
r[0] = n, r[1] = a;
var s = i && i.getViewportRootOffset();
s && (r[0] += s.offsetLeft, r[1] += s.offsetTop);
}
r[2] = r[0] / e.getWidth(), r[3] = r[1] / e.getHeight();
}
var b$ = (
/** @class */
function() {
function r(e, t) {
if (this._show = !1, this._styleCoord = [0, 0, 0, 0], this._enterable = !0, this._alwaysShowContent = !1, this._firstShow = !0, this._longHide = !0, yt.wxa)
return null;
var n = document.createElement("div");
n.domBelongToZr = !0, this.el = n;
var a = this._zr = e.getZr(), i = t.appendTo, o = i && (U(i) ? document.querySelector(i) : _i(i) ? i : K(i) && i(e.getDom()));
vw(this._styleCoord, a, o, e.getWidth() / 2, e.getHeight() / 2), (o || e.getDom()).appendChild(n), this._api = e, this._container = o;
var s = this;
n.onmouseenter = function() {
s._enterable && (clearTimeout(s._hideTimeout), s._show = !0), s._inContent = !0;
}, n.onmousemove = function(l) {
if (l = l || window.event, !s._enterable) {
var u = a.handler, h = a.painter.getViewportRoot();
ur(h, l, !0), u.dispatch("mousemove", l);
}
}, n.onmouseleave = function() {
s._inContent = !1, s._enterable && s._show && s.hideLater(s._hideDelay);
};
}
return r.prototype.update = function(e) {
if (!this._container) {
var t = this._api.getDom(), n = p$(t, "position"), a = t.style;
a.position !== "absolute" && n !== "absolute" && (a.position = "relative");
}
var i = e.get("alwaysShowContent");
i && this._moveIfResized(), this._alwaysShowContent = i, this.el.className = e.get("className") || "";
}, r.prototype.show = function(e, t) {
clearTimeout(this._hideTimeout), clearTimeout(this._longHideTimeout);
var n = this.el, a = n.style, i = this._styleCoord;
n.innerHTML ? a.cssText = g$ + x$(e, !this._firstShow, this._longHide) + cw(i[0], i[1], !0) + ("border-color:" + Ci(t) + ";") + (e.get("extraCssText") || "") + (";pointer-events:" + (this._enterable ? "auto" : "none")) : a.display = "none", this._show = !0, this._firstShow = !1, this._longHide = !1;
}, r.prototype.setContent = function(e, t, n, a, i) {
var o = this.el;
if (e == null) {
o.innerHTML = "";
return;
}
var s = "";
if (U(i) && n.get("trigger") === "item" && !zI(n) && (s = m$(n, a, i)), U(e))
o.innerHTML = e + s;
else if (e) {
o.innerHTML = "", z(e) || (e = [e]);
for (var l = 0; l < e.length; l++)
_i(e[l]) && e[l].parentNode !== o && o.appendChild(e[l]);
if (s && o.childNodes.length) {
var u = document.createElement("div");
u.innerHTML = s, o.appendChild(u);
}
}
}, r.prototype.setEnterable = function(e) {
this._enterable = e;
}, r.prototype.getSize = function() {
var e = this.el;
return e ? [e.offsetWidth, e.offsetHeight] : [0, 0];
}, r.prototype.moveTo = function(e, t) {
if (this.el) {
var n = this._styleCoord;
if (vw(n, this._zr, this._container, e, t), n[0] != null && n[1] != null) {
var a = this.el.style, i = cw(n[0], n[1]);
A(i, function(o) {
a[o[0]] = o[1];
});
}
}
}, r.prototype._moveIfResized = function() {
var e = this._styleCoord[2], t = this._styleCoord[3];
this.moveTo(e * this._zr.getWidth(), t * this._zr.getHeight());
}, r.prototype.hide = function() {
var e = this, t = this.el.style;
t.visibility = "hidden", t.opacity = "0", yt.transform3dSupported && (t.willChange = ""), this._show = !1, this._longHideTimeout = setTimeout(function() {
return e._longHide = !0;
}, 500);
}, r.prototype.hideLater = function(e) {
this._show && !(this._inContent && this._enterable) && !this._alwaysShowContent && (e ? (this._hideDelay = e, this._show = !1, this._hideTimeout = setTimeout(Y(this.hide, this), e)) : this.hide());
}, r.prototype.isShow = function() {
return this._show;
}, r.prototype.dispose = function() {
clearTimeout(this._hideTimeout), clearTimeout(this._longHideTimeout);
var e = this.el.parentNode;
e && e.removeChild(this.el), this.el = this._container = null;
}, r;
}()
), w$ = (
/** @class */
function() {
function r(e) {
this._show = !1, this._styleCoord = [0, 0, 0, 0], this._alwaysShowContent = !1, this._enterable = !0, this._zr = e.getZr(), dw(this._styleCoord, this._zr, e.getWidth() / 2, e.getHeight() / 2);
}
return r.prototype.update = function(e) {
var t = e.get("alwaysShowContent");
t && this._moveIfResized(), this._alwaysShowContent = t;
}, r.prototype.show = function() {
this._hideTimeout && clearTimeout(this._hideTimeout), this.el.show(), this._show = !0;
}, r.prototype.setContent = function(e, t, n, a, i) {
var o = this;
J(e) && Dt(process.env.NODE_ENV !== "production" ? "Passing DOM nodes as content is not supported in richText tooltip!" : ""), this.el && this._zr.remove(this.el);
var s = n.getModel("textStyle");
this.el = new wt({
style: {
rich: t.richTextStyles,
text: e,
lineHeight: 22,
borderWidth: 1,
borderColor: a,
textShadowColor: s.get("textShadowColor"),
fill: n.get(["textStyle", "color"]),
padding: tA(n, "richText"),
verticalAlign: "top",
align: "left"
},
z: n.get("z")
}), A(["backgroundColor", "borderRadius", "shadowColor", "shadowBlur", "shadowOffsetX", "shadowOffsetY"], function(u) {
o.el.style[u] = n.get(u);
}), A(["textShadowBlur", "textShadowOffsetX", "textShadowOffsetY"], function(u) {
o.el.style[u] = s.get(u) || 0;
}), this._zr.add(this.el);
var l = this;
this.el.on("mouseover", function() {
l._enterable && (clearTimeout(l._hideTimeout), l._show = !0), l._inContent = !0;
}), this.el.on("mouseout", function() {
l._enterable && l._show && l.hideLater(l._hideDelay), l._inContent = !1;
});
}, r.prototype.setEnterable = function(e) {
this._enterable = e;
}, r.prototype.getSize = function() {
var e = this.el, t = this.el.getBoundingRect(), n = pw(e.style);
return [t.width + n.left + n.right, t.height + n.top + n.bottom];
}, r.prototype.moveTo = function(e, t) {
var n = this.el;
if (n) {
var a = this._styleCoord;
dw(a, this._zr, e, t), e = a[0], t = a[1];
var i = n.style, o = Xn(i.borderWidth || 0), s = pw(i);
n.x = e + o + s.left, n.y = t + o + s.top, n.markRedraw();
}
}, r.prototype._moveIfResized = function() {
var e = this._styleCoord[2], t = this._styleCoord[3];
this.moveTo(e * this._zr.getWidth(), t * this._zr.getHeight());
}, r.prototype.hide = function() {
this.el && this.el.hide(), this._show = !1;
}, r.prototype.hideLater = function(e) {
this._show && !(this._inContent && this._enterable) && !this._alwaysShowContent && (e ? (this._hideDelay = e, this._show = !1, this._hideTimeout = setTimeout(Y(this.hide, this), e)) : this.hide());
}, r.prototype.isShow = function() {
return this._show;
}, r.prototype.dispose = function() {
this._zr.remove(this.el);
}, r;
}()
);
function Xn(r) {
return Math.max(0, r);
}
function pw(r) {
var e = Xn(r.shadowBlur || 0), t = Xn(r.shadowOffsetX || 0), n = Xn(r.shadowOffsetY || 0);
return {
left: Xn(e - t),
right: Xn(e + t),
top: Xn(e - n),
bottom: Xn(e + n)
};
}
function dw(r, e, t, n) {
r[0] = t, r[1] = n, r[2] = r[0] / e.getWidth(), r[3] = r[1] / e.getHeight();
}
var T$ = new xt({
shape: {
x: -1,
y: -1,
width: 2,
height: 2
}
}), C$ = (
/** @class */
function(r) {
O(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t.type = e.type, t;
}
return e.prototype.init = function(t, n) {
if (!(yt.node || !n.getDom())) {
var a = t.getComponent("tooltip"), i = this._renderMode = mk(a.get("renderMode"));
this._tooltipContent = i === "richText" ? new w$(n) : new b$(n, {
appendTo: a.get("appendToBody", !0) ? "body" : a.get("appendTo", !0)
});
}
}, e.prototype.render = function(t, n, a) {
if (!(yt.node || !a.getDom())) {
this.group.removeAll(), this._tooltipModel = t, this._ecModel = n, this._api = a;
var i = this._tooltipContent;
i.update(t), i.setEnterable(t.get("enterable")), this._initGlobalListener(), this._keepShow(), this._renderMode !== "richText" && t.get("transitionDuration") ? Xo(this, "_updatePosition", 50, "fixRate") : gl(this, "_updatePosition");
}
}, e.prototype._initGlobalListener = function() {
var t = this._tooltipModel, n = t.get("triggerOn");
DI("itemTooltip", this._api, Y(function(a, i, o) {
n !== "none" && (n.indexOf(a) >= 0 ? this._tryShow(i, o) : a === "leave" && this._hide(o));
}, this));
}, e.prototype._keepShow = function() {
var t = this._tooltipModel, n = this._ecModel, a = this._api, i = t.get("triggerOn");
if (this._lastX != null && this._lastY != null && i !== "none" && i !== "click") {
var o = this;
clearTimeout(this._refreshUpdateTimeout), this._refreshUpdateTimeout = setTimeout(function() {
!a.isDisposed() && o.manuallyShowTip(t, n, a, {
x: o._lastX,
y: o._lastY,
dataByCoordSys: o._lastDataByCoordSys
});
});
}
}, e.prototype.manuallyShowTip = function(t, n, a, i) {
if (!(i.from === this.uid || yt.node || !a.getDom())) {
var o = gw(i, a);
this._ticket = "";
var s = i.dataByCoordSys, l = I$(i, n, a);
if (l) {
var u = l.el.getBoundingRect().clone();
u.applyTransform(l.el.transform), this._tryShow({
offsetX: u.x + u.width / 2,
offsetY: u.y + u.height / 2,
target: l.el,
position: i.position,
// When manully trigger, the mouse is not on the el, so we'd better to
// position tooltip on the bottom of the el and display arrow is possible.
positionDefault: "bottom"
}, o);
} else if (i.tooltip && i.x != null && i.y != null) {
var h = T$;
h.x = i.x, h.y = i.y, h.update(), it(h).tooltipConfig = {
name: null,
option: i.tooltip
}, this._tryShow({
offsetX: i.x,
offsetY: i.y,
target: h
}, o);
} else if (s)
this._tryShow({
offsetX: i.x,
offsetY: i.y,
position: i.position,
dataByCoordSys: s,
tooltipOption: i.tooltipOption
}, o);
else if (i.seriesIndex != null) {
if (this._manuallyAxisShowTip(t, n, a, i))
return;
var f = AI(i, n), c = f.point[0], v = f.point[1];
c != null && v != null && this._tryShow({
offsetX: c,
offsetY: v,
target: f.el,
position: i.position,
// When manully trigger, the mouse is not on the el, so we'd better to
// position tooltip on the bottom of the el and display arrow is possible.
positionDefault: "bottom"
}, o);
} else i.x != null && i.y != null && (a.dispatchAction({
type: "updateAxisPointer",
x: i.x,
y: i.y
}), this._tryShow({
offsetX: i.x,
offsetY: i.y,
position: i.position,
target: a.getZr().findHover(i.x, i.y).target
}, o));
}
}, e.prototype.manuallyHideTip = function(t, n, a, i) {
var o = this._tooltipContent;
this._tooltipModel && o.hideLater(this._tooltipModel.get("hideDelay")), this._lastX = this._lastY = this._lastDataByCoordSys = null, i.from !== this.uid && this._hide(gw(i, a));
}, e.prototype._manuallyAxisShowTip = function(t, n, a, i) {
var o = i.seriesIndex, s = i.dataIndex, l = n.getComponent("axisPointer").coordSysAxesInfo;
if (!(o == null || s == null || l == null)) {
var u = n.getSeriesByIndex(o);
if (u) {
var h = u.getData(), f = Cs([h.getItemModel(s), u, (u.coordinateSystem || {}).model], this._tooltipModel);
if (f.get("trigger") === "axis")
return a.dispatchAction({
type: "updateAxisPointer",
seriesIndex: o,
dataIndex: s,
position: i.position
}), !0;
}
}
}, e.prototype._tryShow = function(t, n) {
var a = t.target, i = this._tooltipModel;
if (i) {
this._lastX = t.offsetX, this._lastY = t.offsetY;
var o = t.dataByCoordSys;
if (o && o.length)
this._showAxisTooltip(o, t);
else if (a) {
var s = it(a);
if (s.ssrType === "legend")
return;
this._lastDataByCoordSys = null;
var l, u;
ii(a, function(h) {
if (it(h).dataIndex != null)
return l = h, !0;
if (it(h).tooltipConfig != null)
return u = h, !0;
}, !0), l ? this._showSeriesItemTooltip(t, l, n) : u ? this._showComponentItemTooltip(t, u, n) : this._hide(n);
} else
this._lastDataByCoordSys = null, this._hide(n);
}
}, e.prototype._showOrMove = function(t, n) {
var a = t.get("showDelay");
n = Y(n, this), clearTimeout(this._showTimout), a > 0 ? this._showTimout = setTimeout(n, a) : n();
}, e.prototype._showAxisTooltip = function(t, n) {
var a = this._ecModel, i = this._tooltipModel, o = [n.offsetX, n.offsetY], s = Cs([n.tooltipOption], i), l = this._renderMode, u = [], h = pe("section", {
blocks: [],
noHeader: !0
}), f = [], c = new pv();
A(t, function(m) {
A(m.dataByAxis, function(_) {
var S = a.getComponent(_.axisDim + "Axis", _.axisIndex), x = _.value;
if (!(!S || x == null)) {
var b = wI(x, S.axis, a, _.seriesDataIndices, _.valueLabelOpt), w = pe("section", {
header: b,
noHeader: !Ir(b),
sortBlocks: !0,
blocks: []
});
h.blocks.push(w), A(_.seriesDataIndices, function(T) {
var C = a.getSeriesByIndex(T.seriesIndex), D = T.dataIndexInside, M = C.getDataParams(D);
if (!(M.dataIndex < 0)) {
M.axisDim = _.axisDim, M.axisIndex = _.axisIndex, M.axisType = _.axisType, M.axisId = _.axisId, M.axisValue = Xy(S.axis, {
value: x
}), M.axisValueLabel = b, M.marker = c.makeTooltipMarker("item", Ci(M.color), l);
var I = Q_(C.formatTooltip(D, !0, null)), L = I.frag;
if (L) {
var E = Cs([C], i).get("valueFormatter");
w.blocks.push(E ? B({
valueFormatter: E
}, L) : L);
}
I.text && f.push(I.text), u.push(M);
}
});
}
});
}), h.blocks.reverse(), f.reverse();
var v = n.position, p = s.get("order"), d = a1(h, c, l, p, a.get("useUTC"), s.get("textStyle"));
d && f.unshift(d);
var g = l === "richText" ? `
` : "<br/>", y = f.join(g);
this._showOrMove(s, function() {
this._updateContentNotChangedOnAxis(t, u) ? this._updatePosition(s, v, o[0], o[1], this._tooltipContent, u) : this._showTooltipContent(s, y, u, Math.random() + "", o[0], o[1], v, null, c);
});
}, e.prototype._showSeriesItemTooltip = function(t, n, a) {
var i = this._ecModel, o = it(n), s = o.seriesIndex, l = i.getSeriesByIndex(s), u = o.dataModel || l, h = o.dataIndex, f = o.dataType, c = u.getData(f), v = this._renderMode, p = t.positionDefault, d = Cs([c.getItemModel(h), u, l && (l.coordinateSystem || {}).model], this._tooltipModel, p ? {
position: p
} : null), g = d.get("trigger");
if (!(g != null && g !== "item")) {
var y = u.getDataParams(h, f), m = new pv();
y.marker = m.makeTooltipMarker("item", Ci(y.color), v);
var _ = Q_(u.formatTooltip(h, !1, f)), S = d.get("order"), x = d.get("valueFormatter"), b = _.frag, w = b ? a1(x ? B({
valueFormatter: x
}, b) : b, m, v, S, i.get("useUTC"), d.get("textStyle")) : _.text, T = "item_" + u.name + "_" + h;
this._showOrMove(d, function() {
this._showTooltipContent(d, w, y, T, t.offsetX, t.offsetY, t.position, t.target, m);
}), a({
type: "showTip",
dataIndexInside: h,
dataIndex: c.getRawIndex(h),
seriesIndex: s,
from: this.uid
});
}
}, e.prototype._showComponentItemTooltip = function(t, n, a) {
var i = this._renderMode === "html", o = it(n), s = o.tooltipConfig, l = s.option || {}, u = l.encodeHTMLContent;
if (U(l)) {
var h = l;
l = {
content: h,
// Fixed formatter
formatter: h
}, u = !0;
}
u && i && l.content && (l = nt(l), l.content = ke(l.content));
var f = [l], c = this._ecModel.getComponent(o.componentMainType, o.componentIndex);
c && f.push(c), f.push({
formatter: l.content
});
var v = t.positionDefault, p = Cs(f, this._tooltipModel, v ? {
position: v
} : null), d = p.get("content"), g = Math.random() + "", y = new pv();
this._showOrMove(p, function() {
var m = nt(p.get("formatterParams") || {});
this._showTooltipContent(p, d, m, g, t.offsetX, t.offsetY, t.position, n, y);
}), a({
type: "showTip",
from: this.uid
});
}, e.prototype._showTooltipContent = function(t, n, a, i, o, s, l, u, h) {
if (this._ticket = "", !(!t.get("showContent") || !t.get("show"))) {
var f = this._tooltipContent;
f.setEnterable(t.get("enterable"));
var c = t.get("formatter");
l = l || t.get("position");
var v = n, p = this._getNearestPoint([o, s], a, t.get("trigger"), t.get("borderColor")), d = p.color;
if (c)
if (U(c)) {
var g = t.ecModel.get("useUTC"), y = z(a) ? a[0] : a, m = y && y.axisType && y.axisType.indexOf("time") >= 0;
v = c, m && (v = Kf(y.axisValue, v, g)), v = bD(v, a, !0);
} else if (K(c)) {
var _ = Y(function(S, x) {
S === this._ticket && (f.setContent(x, h, t, d, l), this._updatePosition(t, l, o, s, f, a, u));
}, this);
this._ticket = i, v = c(a, i, _);
} else
v = c;
f.setContent(v, h, t, d, l), f.show(t, d), this._updatePosition(t, l, o, s, f, a, u);
}
}, e.prototype._getNearestPoint = function(t, n, a, i) {
if (a === "axis" || z(n))
return {
color: i || (this._renderMode === "html" ? "#fff" : "none")
};
if (!z(n))
return {
color: i || n.color || n.borderColor
};
}, e.prototype._updatePosition = function(t, n, a, i, o, s, l) {
var u = this._api.getWidth(), h = this._api.getHeight();
n = n || t.get("position");
var f = o.getSize(), c = t.get("align"), v = t.get("verticalAlign"), p = l && l.getBoundingRect().clone();
if (l && p.applyTransform(l.transform), K(n) && (n = n([a, i], s, o.el, p, {
viewSize: [u, h],
contentSize: f.slice()
})), z(n))
a = W(n[0], u), i = W(n[1], h);
else if (J(n)) {
var d = n;
d.width = f[0], d.height = f[1];
var g = se(d, {
width: u,
height: h
});
a = g.x, i = g.y, c = null, v = null;
} else if (U(n) && l) {
var y = M$(n, p, f, t.get("borderWidth"));
a = y[0], i = y[1];
} else {
var y = D$(a, i, o, u, h, c ? null : 20, v ? null : 20);
a = y[0], i = y[1];
}
if (c && (a -= yw(c) ? f[0] / 2 : c === "right" ? f[0] : 0), v && (i -= yw(v) ? f[1] / 2 : v === "bottom" ? f[1] : 0), zI(t)) {
var y = A$(a, i, o, u, h);
a = y[0], i = y[1];
}
o.moveTo(a, i);
}, e.prototype._updateContentNotChangedOnAxis = function(t, n) {
var a = this._lastDataByCoordSys, i = this._cbParamsList, o = !!a && a.length === t.length;
return o && A(a, function(s, l) {
var u = s.dataByAxis || [], h = t[l] || {}, f = h.dataByAxis || [];
o = o && u.length === f.length, o && A(u, function(c, v) {
var p = f[v] || {}, d = c.seriesDataIndices || [], g = p.seriesDataIndices || [];
o = o && c.value === p.value && c.axisType === p.axisType && c.axisId === p.axisId && d.length === g.length, o && A(d, function(y, m) {
var _ = g[m];
o = o && y.seriesIndex === _.seriesIndex && y.dataIndex === _.dataIndex;
}), i && A(c.seriesDataIndices, function(y) {
var m = y.seriesIndex, _ = n[m], S = i[m];
_ && S && S.data !== _.data && (o = !1);
});
});
}), this._lastDataByCoordSys = t, this._cbParamsList = n, !!o;
}, e.prototype._hide = function(t) {
this._lastDataByCoordSys = null, t({
type: "hideTip",
from: this.uid
});
}, e.prototype.dispose = function(t, n) {
yt.node || !n.getDom() || (gl(this, "_updatePosition"), this._tooltipContent.dispose(), wg("itemTooltip", n));
}, e.type = "tooltip", e;
}(Yt)
);
function Cs(r, e, t) {
var n = e.ecModel, a;
t ? (a = new It(t, n, n), a = new It(e.option, a, n)) : a = e;
for (var i = r.length - 1; i >= 0; i--) {
var o = r[i];
o && (o instanceof It && (o = o.get("tooltip", !0)), U(o) && (o = {
formatter: o
}), o && (a = new It(o, a, n)));
}
return a;
}
function gw(r, e) {
return r.dispatchAction || Y(e.dispatchAction, e);
}
function D$(r, e, t, n, a, i, o) {
var s = t.getSize(), l = s[0], u = s[1];
return i != null && (r + l + i + 2 > n ? r -= l + i : r += i), o != null && (e + u + o > a ? e -= u + o : e += o), [r, e];
}
function A$(r, e, t, n, a) {
var i = t.getSize(), o = i[0], s = i[1];
return r = Math.min(r + o, n) - o, e = Math.min(e + s, a) - s, r = Math.max(r, 0), e = Math.max(e, 0), [r, e];
}
function M$(r, e, t, n) {
var a = t[0], i = t[1], o = Math.ceil(Math.SQRT2 * n) + 8, s = 0, l = 0, u = e.width, h = e.height;
switch (r) {
case "inside":
s = e.x + u / 2 - a / 2, l = e.y + h / 2 - i / 2;
break;
case "top":
s = e.x + u / 2 - a / 2, l = e.y - i - o;
break;
case "bottom":
s = e.x + u / 2 - a / 2, l = e.y + h + o;
break;
case "left":
s = e.x - a - o, l = e.y + h / 2 - i / 2;
break;
case "right":
s = e.x + u + o, l = e.y + h / 2 - i / 2;
}
return [s, l];
}
function yw(r) {
return r === "center" || r === "middle";
}
function I$(r, e, t) {
var n = uy(r).queryOptionMap, a = n.keys()[0];
if (!(!a || a === "series")) {
var i = Ol(e, a, n.get(a), {
useDefault: !1,
enableAll: !1,
enableNone: !1
}), o = i.models[0];
if (o) {
var s = t.getViewOfComponentModel(o), l;
if (s.group.traverse(function(u) {
var h = it(u).tooltipConfig;
if (h && h.name === r.name)
return l = u, !0;
}), l)
return {
componentMainType: a,
componentIndex: o.componentIndex,
el: l
};
}
}
}
function L$(r) {
gt(tu), r.registerComponentModel(c$), r.registerComponentView(C$), r.registerAction({
type: "showTip",
event: "showTip",
update: "tooltip:manuallyShowTip"
}, Jt), r.registerAction({
type: "hideTip",
event: "hideTip",
update: "tooltip:manuallyHideTip"
}, Jt);
}
var E$ = ["rect", "polygon", "keep", "clear"];
function P$(r, e) {
var t = Pt(r ? r.brush : []);
if (t.length) {
var n = [];
A(t, function(l) {
var u = l.hasOwnProperty("toolbox") ? l.toolbox : [];
u instanceof Array && (n = n.concat(u));
});
var a = r && r.toolbox;
z(a) && (a = a[0]), a || (a = {
feature: {}
}, r.toolbox = [a]);
var i = a.feature || (a.feature = {}), o = i.brush || (i.brush = {}), s = o.type || (o.type = []);
s.push.apply(s, n), k$(s), e && !s.length && s.push.apply(s, E$);
}
}
function k$(r) {
var e = {};
A(r, function(t) {
e[t] = 1;
}), r.length = 0, A(e, function(t, n) {
r.push(n);
});
}
var mw = A;
function _w(r) {
if (r) {
for (var e in r)
if (r.hasOwnProperty(e))
return !0;
}
}
function Ig(r, e, t) {
var n = {};
return mw(e, function(i) {
var o = n[i] = a();
mw(r[i], function(s, l) {
if (ce.isValidType(l)) {
var u = {
type: l,
visual: s
};
t && t(u, i), o[l] = new ce(u), l === "opacity" && (u = nt(u), u.type = "colorAlpha", o.__hidden.__alphaForOpacity = new ce(u));
}
});
}), n;
function a() {
var i = function() {
};
i.prototype.__hidden = i.prototype;
var o = new i();
return o;
}
}
function WI(r, e, t) {
var n;
A(t, function(a) {
e.hasOwnProperty(a) && _w(e[a]) && (n = !0);
}), n && A(t, function(a) {
e.hasOwnProperty(a) && _w(e[a]) ? r[a] = nt(e[a]) : delete r[a];
});
}
function R$(r, e, t, n, a, i) {
var o = {};
A(r, function(f) {
var c = ce.prepareVisualTypes(e[f]);
o[f] = c;
});
var s;
function l(f) {
return By(t, s, f);
}
function u(f, c) {
hA(t, s, f, c);
}
t.each(h);
function h(f, c) {
s = f;
var v = t.getRawDataItem(s);
if (!(v && v.visualMap === !1))
for (var p = n.call(a, f), d = e[p], g = o[p], y = 0, m = g.length; y < m; y++) {
var _ = g[y];
d[_] && d[_].applyVisual(f, l, u);
}
}
}
function N$(r, e, t, n) {
var a = {};
return A(r, function(i) {
var o = ce.prepareVisualTypes(e[i]);
a[i] = o;
}), {
progress: function(o, s) {
var l;
n != null && (l = s.getDimensionIndex(n));
function u(x) {
return By(s, f, x);
}
function h(x, b) {
hA(s, f, x, b);
}
for (var f, c = s.getStore(); (f = o.next()) != null; ) {
var v = s.getRawDataItem(f);
if (!(v && v.visualMap === !1))
for (var p = n != null ? c.get(l, f) : f, d = t(p), g = e[d], y = a[d], m = 0, _ = y.length; m < _; m++) {
var S = y[m];
g[S] && g[S].applyVisual(p, u, h);
}
}
}
};
}
function O$(r) {
var e = r.brushType, t = {
point: function(n) {
return Sw[e].point(n, t, r);
},
rect: function(n) {
return Sw[e].rect(n, t, r);
}
};
return t;
}
var Sw = {
lineX: xw(0),
lineY: xw(1),
rect: {
point: function(r, e, t) {
return r && t.boundingRect.contain(r[0], r[1]);
},
rect: function(r, e, t) {
return r && t.boundingRect.intersect(r);
}
},
polygon: {
point: function(r, e, t) {
return r && t.boundingRect.contain(r[0], r[1]) && ja(t.range, r[0], r[1]);
},
rect: function(r, e, t) {
var n = t.range;
if (!r || n.length <= 1)
return !1;
var a = r.x, i = r.y, o = r.width, s = r.height, l = n[0];
if (ja(n, a, i) || ja(n, a + o, i) || ja(n, a, i + s) || ja(n, a + o, i + s) || ct.create(r).contain(l[0], l[1]) || Ns(a, i, a + o, i, n) || Ns(a, i, a, i + s, n) || Ns(a + o, i, a + o, i + s, n) || Ns(a, i + s, a + o, i + s, n))
return !0;
}
}
};
function xw(r) {
var e = ["x", "y"], t = ["width", "height"];
return {
point: function(n, a, i) {
if (n) {
var o = i.range, s = n[r];
return Ds(s, o);
}
},
rect: function(n, a, i) {
if (n) {
var o = i.range, s = [n[e[r]], n[e[r]] + n[t[r]]];
return s[1] < s[0] && s.reverse(), Ds(s[0], o) || Ds(s[1], o) || Ds(o[0], s) || Ds(o[1], s);
}
}
};
}
function Ds(r, e) {
return e[0] <= r && r <= e[1];
}
var bw = ["inBrush", "outOfBrush"], Ep = "__ecBrushSelect", Lg = "__ecInBrushSelectEvent";
function $I(r) {
r.eachComponent({
mainType: "brush"
}, function(e) {
var t = e.brushTargetManager = new Zm(e.option, r);
t.setInputRanges(e.areas, r);
});
}
function V$(r, e, t) {
var n = [], a, i;
r.eachComponent({
mainType: "brush"
}, function(o) {
t && t.type === "takeGlobalCursor" && o.setBrushOption(t.key === "brush" ? t.brushOption : {
brushType: !1
});
}), $I(r), r.eachComponent({
mainType: "brush"
}, function(o, s) {
var l = {
brushId: o.id,
brushIndex: s,
brushName: o.name,
areas: nt(o.areas),
selected: []
};
n.push(l);
var u = o.option, h = u.brushLink, f = [], c = [], v = [], p = !1;
s || (a = u.throttleType, i = u.throttleDelay);
var d = G(o.areas, function(x) {
var b = F$[x.brushType], w = et({
boundingRect: b ? b(x) : void 0
}, x);
return w.selectors = O$(w), w;
}), g = Ig(o.option, bw, function(x) {
x.mappingMethod = "fixed";
});
z(h) && A(h, function(x) {
f[x] = 1;
});
function y(x) {
return h === "all" || !!f[x];
}
function m(x) {
return !!x.length;
}
r.eachSeries(function(x, b) {
var w = v[b] = [];
x.subType === "parallel" ? _(x, b) : S(x, b, w);
});
function _(x, b) {
var w = x.coordinateSystem;
p = p || w.hasAxisBrushed(), y(b) && w.eachActiveState(x.getData(), function(T, C) {
T === "active" && (c[C] = 1);
});
}
function S(x, b, w) {
if (!(!x.brushSelector || G$(o, b)) && (A(d, function(C) {
o.brushTargetManager.controlSeries(C, x, r) && w.push(C), p = p || m(w);
}), y(b) && m(w))) {
var T = x.getData();
T.each(function(C) {
ww(x, w, T, C) && (c[C] = 1);
});
}
}
r.eachSeries(function(x, b) {
var w = {
seriesId: x.id,
seriesIndex: b,
seriesName: x.name,
dataIndex: []
};
l.selected.push(w);
var T = v[b], C = x.getData(), D = y(b) ? function(M) {
return c[M] ? (w.dataIndex.push(C.getRawIndex(M)), "inBrush") : "outOfBrush";
} : function(M) {
return ww(x, T, C, M) ? (w.dataIndex.push(C.getRawIndex(M)), "inBrush") : "outOfBrush";
};
(y(b) ? p : m(T)) && R$(bw, g, C, D);
});
}), B$(e, a, i, n, t);
}
function B$(r, e, t, n, a) {
if (a) {
var i = r.getZr();
if (!i[Lg]) {
i[Ep] || (i[Ep] = z$);
var o = Xo(i, Ep, t, e);
o(r, n);
}
}
}
function z$(r, e) {
if (!r.isDisposed()) {
var t = r.getZr();
t[Lg] = !0, r.dispatchAction({
type: "brushSelect",
batch: e
}), t[Lg] = !1;
}
}
function ww(r, e, t, n) {
for (var a = 0, i = e.length; a < i; a++) {
var o = e[a];
if (r.brushSelector(n, t, o.selectors, o))
return !0;
}
}
function G$(r, e) {
var t = r.option.seriesIndex;
return t != null && t !== "all" && (z(t) ? pt(t, e) < 0 : e !== t);
}
var F$ = {
rect: function(r) {
return Tw(r.range);
},
polygon: function(r) {
for (var e, t = r.range, n = 0, a = t.length; n < a; n++) {
e = e || [[1 / 0, -1 / 0], [1 / 0, -1 / 0]];
var i = t[n];
i[0] < e[0][0] && (e[0][0] = i[0]), i[0] > e[0][1] && (e[0][1] = i[0]), i[1] < e[1][0] && (e[1][0] = i[1]), i[1] > e[1][1] && (e[1][1] = i[1]);
}
return e && Tw(e);
}
};
function Tw(r) {
return new ct(r[0][0], r[1][0], r[0][1] - r[0][0], r[1][1] - r[1][0]);
}
var H$ = (
/** @class */
function(r) {
O(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t.type = e.type, t;
}
return e.prototype.init = function(t, n) {
this.ecModel = t, this.api = n, this.model, (this._brushController = new Sm(n.getZr())).on("brush", Y(this._onBrush, this)).mount();
}, e.prototype.render = function(t, n, a, i) {
this.model = t, this._updateController(t, n, a, i);
}, e.prototype.updateTransform = function(t, n, a, i) {
$I(n), this._updateController(t, n, a, i);
}, e.prototype.updateVisual = function(t, n, a, i) {
this.updateTransform(t, n, a, i);
}, e.prototype.updateView = function(t, n, a, i) {
this._updateController(t, n, a, i);
}, e.prototype._updateController = function(t, n, a, i) {
(!i || i.$from !== t.id) && this._brushController.setPanels(t.brushTargetManager.makePanelOpts(a)).enableBrush(t.brushOption).updateCovers(t.areas.slice());
}, e.prototype.dispose = function() {
this._brushController.dispose();
}, e.prototype._onBrush = function(t) {
var n = this.model.id, a = this.model.brushTargetManager.setOutputRanges(t.areas, this.ecModel);
(!t.isEnd || t.removeOnClick) && this.api.dispatchAction({
type: "brush",
brushId: n,
areas: nt(a),
$from: n
}), t.isEnd && this.api.dispatchAction({
type: "brushEnd",
brushId: n,
areas: nt(a),
$from: n
});
}, e.type = "brush", e;
}(Yt)
), W$ = "#ddd", $$ = (
/** @class */
function(r) {
O(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t.type = e.type, t.areas = [], t.brushOption = {}, t;
}
return e.prototype.optionUpdated = function(t, n) {
var a = this.option;
!n && WI(a, t, ["inBrush", "outOfBrush"]);
var i = a.inBrush = a.inBrush || {};
a.outOfBrush = a.outOfBrush || {
color: W$
}, i.hasOwnProperty("liftZ") || (i.liftZ = 5);
}, e.prototype.setAreas = function(t) {
process.env.NODE_ENV !== "production" && (tt(z(t)), A(t, function(n) {
tt(n.brushType, "Illegal areas");
})), t && (this.areas = G(t, function(n) {
return Cw(this.option, n);
}, this));
}, e.prototype.setBrushOption = function(t) {
this.brushOption = Cw(this.option, t), this.brushType = this.brushOption.brushType;
}, e.type = "brush", e.dependencies = ["geo", "grid", "xAxis", "yAxis", "parallel", "series"], e.defaultOption = {
seriesIndex: "all",
brushType: "rect",
brushMode: "single",
transformable: !0,
brushStyle: {
borderWidth: 1,
color: "rgba(210,219,238,0.3)",
borderColor: "#D2DBEE"
},
throttleType: "fixRate",
throttleDelay: 0,
removeOnClick: !0,
z: 1e4
}, e;
}(_t)
);
function Cw(r, e) {
return ht({
brushType: r.brushType,
brushMode: r.brushMode,
transformable: r.transformable,
brushStyle: new It(r.brushStyle).getItemStyle(),
removeOnClick: r.removeOnClick,
z: r.z
}, e, !0);
}
var U$ = ["rect", "polygon", "lineX", "lineY", "keep", "clear"], Y$ = (
/** @class */
function(r) {
O(e, r);
function e() {
return r !== null && r.apply(this, arguments) || this;
}
return e.prototype.render = function(t, n, a) {
var i, o, s;
n.eachComponent({
mainType: "brush"
}, function(l) {
i = l.brushType, o = l.brushOption.brushMode || "single", s = s || !!l.areas.length;
}), this._brushType = i, this._brushMode = o, A(t.get("type", !0), function(l) {
t.setIconStatus(l, (l === "keep" ? o === "multiple" : l === "clear" ? s : l === i) ? "emphasis" : "normal");
});
}, e.prototype.updateView = function(t, n, a) {
this.render(t, n, a);
}, e.prototype.getIcons = function() {
var t = this.model, n = t.get("icon", !0), a = {};
return A(t.get("type", !0), function(i) {
n[i] && (a[i] = n[i]);
}), a;
}, e.prototype.onclick = function(t, n, a) {
var i = this._brushType, o = this._brushMode;
a === "clear" ? (n.dispatchAction({
type: "axisAreaSelect",
intervals: []
}), n.dispatchAction({
type: "brush",
command: "clear",
// Clear all areas of all brush components.
areas: []
})) : n.dispatchAction({
type: "takeGlobalCursor",
key: "brush",
brushOption: {
brushType: a === "keep" ? i : i === a ? !1 : a,
brushMode: a === "keep" ? o === "multiple" ? "single" : "multiple" : o
}
});
}, e.getDefaultOption = function(t) {
var n = {
show: !0,
type: U$.slice(),
icon: {
/* eslint-disable */
rect: "M7.3,34.7 M0.4,10V-0.2h9.8 M89.6,10V-0.2h-9.8 M0.4,60v10.2h9.8 M89.6,60v10.2h-9.8 M12.3,22.4V10.5h13.1 M33.6,10.5h7.8 M49.1,10.5h7.8 M77.5,22.4V10.5h-13 M12.3,31.1v8.2 M77.7,31.1v8.2 M12.3,47.6v11.9h13.1 M33.6,59.5h7.6 M49.1,59.5 h7.7 M77.5,47.6v11.9h-13",
polygon: "M55.2,34.9c1.7,0,3.1,1.4,3.1,3.1s-1.4,3.1-3.1,3.1 s-3.1-1.4-3.1-3.1S53.5,34.9,55.2,34.9z M50.4,51c1.7,0,3.1,1.4,3.1,3.1c0,1.7-1.4,3.1-3.1,3.1c-1.7,0-3.1-1.4-3.1-3.1 C47.3,52.4,48.7,51,50.4,51z M55.6,37.1l1.5-7.8 M60.1,13.5l1.6-8.7l-7.8,4 M59,19l-1,5.3 M24,16.1l6.4,4.9l6.4-3.3 M48.5,11.6 l-5.9,3.1 M19.1,12.8L9.7,5.1l1.1,7.7 M13.4,29.8l1,7.3l6.6,1.6 M11.6,18.4l1,6.1 M32.8,41.9 M26.6,40.4 M27.3,40.2l6.1,1.6 M49.9,52.1l-5.6-7.6l-4.9-1.2",
lineX: "M15.2,30 M19.7,15.6V1.9H29 M34.8,1.9H40.4 M55.3,15.6V1.9H45.9 M19.7,44.4V58.1H29 M34.8,58.1H40.4 M55.3,44.4 V58.1H45.9 M12.5,20.3l-9.4,9.6l9.6,9.8 M3.1,29.9h16.5 M62.5,20.3l9.4,9.6L62.3,39.7 M71.9,29.9H55.4",
lineY: "M38.8,7.7 M52.7,12h13.2v9 M65.9,26.6V32 M52.7,46.3h13.2v-9 M24.9,12H11.8v9 M11.8,26.6V32 M24.9,46.3H11.8v-9 M48.2,5.1l-9.3-9l-9.4,9.2 M38.9-3.9V12 M48.2,53.3l-9.3,9l-9.4-9.2 M38.9,62.3V46.4",
keep: "M4,10.5V1h10.3 M20.7,1h6.1 M33,1h6.1 M55.4,10.5V1H45.2 M4,17.3v6.6 M55.6,17.3v6.6 M4,30.5V40h10.3 M20.7,40 h6.1 M33,40h6.1 M55.4,30.5V40H45.2 M21,18.9h62.9v48.6H21V18.9z",
clear: "M22,14.7l30.9,31 M52.9,14.7L22,45.7 M4.7,16.8V4.2h13.1 M26,4.2h7.8 M41.6,4.2h7.8 M70.3,16.8V4.2H57.2 M4.7,25.9v8.6 M70.3,25.9v8.6 M4.7,43.2v12.6h13.1 M26,55.8h7.8 M41.6,55.8h7.8 M70.3,43.2v12.6H57.2"
// jshint ignore:line
/* eslint-enable */
},
// `rect`, `polygon`, `lineX`, `lineY`, `keep`, `clear`
title: t.getLocaleModel().get(["toolbox", "brush", "title"])
};
return n;
}, e;
}(pr)
);
function Z$(r) {
r.registerComponentView(H$), r.registerComponentModel($$), r.registerPreprocessor(P$), r.registerVisual(r.PRIORITY.VISUAL.BRUSH, V$), r.registerAction({
type: "brush",
event: "brush",
update: "updateVisual"
}, function(e, t) {
t.eachComponent({
mainType: "brush",
query: e
}, function(n) {
n.setAreas(e.areas);
});
}), r.registerAction({
type: "brushSelect",
event: "brushSelected",
update: "none"
}, Jt), r.registerAction({
type: "brushEnd",
event: "brushEnd",
update: "none"
}, Jt), co("brush", Y$);
}
var X$ = (
/** @class */
function(r) {
O(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t.type = e.type, t.layoutMode = {
type: "box",
ignoreSize: !0
}, t;
}
return e.type = "title", e.defaultOption = {
// zlevel: 0,
z: 6,
show: !0,
text: "",
target: "blank",
subtext: "",
subtarget: "blank",
left: 0,
top: 0,
backgroundColor: "rgba(0,0,0,0)",
borderColor: "#ccc",
borderWidth: 0,
padding: 5,
itemGap: 10,
textStyle: {
fontSize: 18,
fontWeight: "bold",
color: "#464646"
},
subtextStyle: {
fontSize: 12,
color: "#6E7079"
}
}, e;
}(_t)
), q$ = (
/** @class */
function(r) {
O(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t.type = e.type, t;
}
return e.prototype.render = function(t, n, a) {
if (this.group.removeAll(), !!t.get("show")) {
var i = this.group, o = t.getModel("textStyle"), s = t.getModel("subtextStyle"), l = t.get("textAlign"), u = ot(t.get("textBaseline"), t.get("textVerticalAlign")), h = new wt({
style: Gt(o, {
text: t.get("text"),
fill: o.getTextColor()
}, {
disableBox: !0
}),
z2: 10
}), f = h.getBoundingRect(), c = t.get("subtext"), v = new wt({
style: Gt(s, {
text: c,
fill: s.getTextColor(),
y: f.height + t.get("itemGap"),
verticalAlign: "top"
}, {
disableBox: !0
}),
z2: 10
}), p = t.get("link"), d = t.get("sublink"), g = t.get("triggerEvent", !0);
h.silent = !p && !g, v.silent = !d && !g, p && h.on("click", function() {
$h(p, "_" + t.get("target"));
}), d && v.on("click", function() {
$h(d, "_" + t.get("subtarget"));
}), it(h).eventData = it(v).eventData = g ? {
componentType: "title",
componentIndex: t.componentIndex
} : null, i.add(h), c && i.add(v);
var y = i.getBoundingRect(), m = t.getBoxLayoutParams();
m.width = y.width, m.height = y.height;
var _ = se(m, {
width: a.getWidth(),
height: a.getHeight()
}, t.get("padding"));
l || (l = t.get("left") || t.get("right"), l === "middle" && (l = "center"), l === "right" ? _.x += _.width : l === "center" && (_.x += _.width / 2)), u || (u = t.get("top") || t.get("bottom"), u === "center" && (u = "middle"), u === "bottom" ? _.y += _.height : u === "middle" && (_.y += _.height / 2), u = u || "top"), i.x = _.x, i.y = _.y, i.markRedraw();
var S = {
align: l,
verticalAlign: u
};
h.setStyle(S), v.setStyle(S), y = i.getBoundingRect();
var x = _.margin, b = t.getItemStyle(["color", "opacity"]);
b.fill = t.get("backgroundColor");
var w = new xt({
shape: {
x: y.x - x[3],
y: y.y - x[0],
width: y.width + x[1] + x[3],
height: y.height + x[0] + x[2],
r: t.get("borderRadius")
},
style: b,
subPixelOptimize: !0,
silent: !0
});
i.add(w);
}
}, e.type = "title", e;
}(Yt)
);
function K$(r) {
r.registerComponentModel(X$), r.registerComponentView(q$);
}
var Dw = (
/** @class */
function(r) {
O(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t.type = e.type, t.layoutMode = "box", t;
}
return e.prototype.init = function(t, n, a) {
this.mergeDefaultAndTheme(t, a), this._initData();
}, e.prototype.mergeOption = function(t) {
r.prototype.mergeOption.apply(this, arguments), this._initData();
}, e.prototype.setCurrentIndex = function(t) {
t == null && (t = this.option.currentIndex);
var n = this._data.count();
this.option.loop ? t = (t % n + n) % n : (t >= n && (t = n - 1), t < 0 && (t = 0)), this.option.currentIndex = t;
}, e.prototype.getCurrentIndex = function() {
return this.option.currentIndex;
}, e.prototype.isIndexMax = function() {
return this.getCurrentIndex() >= this._data.count() - 1;
}, e.prototype.setPlayState = function(t) {
this.option.autoPlay = !!t;
}, e.prototype.getPlayState = function() {
return !!this.option.autoPlay;
}, e.prototype._initData = function() {
var t = this.option, n = t.data || [], a = t.axisType, i = this._names = [], o;
a === "category" ? (o = [], A(n, function(u, h) {
var f = oe(Bo(u), ""), c;
J(u) ? (c = nt(u), c.value = h) : c = h, o.push(c), i.push(f);
})) : o = n;
var s = {
category: "ordinal",
time: "time",
value: "number"
}[a] || "number", l = this._data = new Ne([{
name: "value",
type: s
}], this);
l.initData(o, i);
}, e.prototype.getData = function() {
return this._data;
}, e.prototype.getCategories = function() {
if (this.get("axisType") === "category")
return this._names.slice();
}, e.type = "timeline", e.defaultOption = {
// zlevel: 0, // 一级层叠
z: 4,
show: !0,
axisType: "time",
realtime: !0,
left: "20%",
top: null,
right: "20%",
bottom: 0,
width: null,
height: 40,
padding: 5,
controlPosition: "left",
autoPlay: !1,
rewind: !1,
loop: !0,
playInterval: 2e3,
currentIndex: 0,
itemStyle: {},
label: {
color: "#000"
},
data: []
}, e;
}(_t)
), UI = (
/** @class */
function(r) {
O(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t.type = e.type, t;
}
return e.type = "timeline.slider", e.defaultOption = _a(Dw.defaultOption, {
backgroundColor: "rgba(0,0,0,0)",
borderColor: "#ccc",
borderWidth: 0,
orient: "horizontal",
inverse: !1,
tooltip: {
trigger: "item"
// data item may also have tootip attr.
},
symbol: "circle",
symbolSize: 12,
lineStyle: {
show: !0,
width: 2,
color: "#DAE1F5"
},
label: {
position: "auto",
// When using number, label position is not
// restricted by viewRect.
// positive: right/bottom, negative: left/top
show: !0,
interval: "auto",
rotate: 0,
// formatter: null,
// 其余属性默认使用全局文本样式,详见TEXTSTYLE
color: "#A4B1D7"
},
itemStyle: {
color: "#A4B1D7",
borderWidth: 1
},
checkpointStyle: {
symbol: "circle",
symbolSize: 15,
color: "#316bf3",
borderColor: "#fff",
borderWidth: 2,
shadowBlur: 2,
shadowOffsetX: 1,
shadowOffsetY: 1,
shadowColor: "rgba(0, 0, 0, 0.3)",
// borderColor: 'rgba(194,53,49, 0.5)',
animation: !0,
animationDuration: 300,
animationEasing: "quinticInOut"
},
controlStyle: {
show: !0,
showPlayBtn: !0,
showPrevBtn: !0,
showNextBtn: !0,
itemSize: 24,
itemGap: 12,
position: "left",
playIcon: "path://M31.6,53C17.5,53,6,41.5,6,27.4S17.5,1.8,31.6,1.8C45.7,1.8,57.2,13.3,57.2,27.4S45.7,53,31.6,53z M31.6,3.3 C18.4,3.3,7.5,14.1,7.5,27.4c0,13.3,10.8,24.1,24.1,24.1C44.9,51.5,55.7,40.7,55.7,27.4C55.7,14.1,44.9,3.3,31.6,3.3z M24.9,21.3 c0-2.2,1.6-3.1,3.5-2l10.5,6.1c1.899,1.1,1.899,2.9,0,4l-10.5,6.1c-1.9,1.1-3.5,0.2-3.5-2V21.3z",
stopIcon: "path://M30.9,53.2C16.8,53.2,5.3,41.7,5.3,27.6S16.8,2,30.9,2C45,2,56.4,13.5,56.4,27.6S45,53.2,30.9,53.2z M30.9,3.5C17.6,3.5,6.8,14.4,6.8,27.6c0,13.3,10.8,24.1,24.101,24.1C44.2,51.7,55,40.9,55,27.6C54.9,14.4,44.1,3.5,30.9,3.5z M36.9,35.8c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H36c0.5,0,0.9,0.4,0.9,1V35.8z M27.8,35.8 c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H27c0.5,0,0.9,0.4,0.9,1L27.8,35.8L27.8,35.8z",
// eslint-disable-next-line max-len
nextIcon: "M2,18.5A1.52,1.52,0,0,1,.92,18a1.49,1.49,0,0,1,0-2.12L7.81,9.36,1,3.11A1.5,1.5,0,1,1,3,.89l8,7.34a1.48,1.48,0,0,1,.49,1.09,1.51,1.51,0,0,1-.46,1.1L3,18.08A1.5,1.5,0,0,1,2,18.5Z",
// eslint-disable-next-line max-len
prevIcon: "M10,.5A1.52,1.52,0,0,1,11.08,1a1.49,1.49,0,0,1,0,2.12L4.19,9.64,11,15.89a1.5,1.5,0,1,1-2,2.22L1,10.77A1.48,1.48,0,0,1,.5,9.68,1.51,1.51,0,0,1,1,8.58L9,.92A1.5,1.5,0,0,1,10,.5Z",
prevBtnSize: 18,
nextBtnSize: 18,
color: "#A4B1D7",
borderColor: "#A4B1D7",
borderWidth: 1
},
emphasis: {
label: {
show: !0,
// 其余属性默认使用全局文本样式,详见TEXTSTYLE
color: "#6f778d"
},
itemStyle: {
color: "#316BF3"
},
controlStyle: {
color: "#316BF3",
borderColor: "#316BF3",
borderWidth: 2
}
},
progress: {
lineStyle: {
color: "#316BF3"
},
itemStyle: {
color: "#316BF3"
},
label: {
color: "#6f778d"
}
},
data: []
}), e;
}(Dw)
);
ie(UI, nc.prototype);
var j$ = (
/** @class */
function(r) {
O(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t.type = e.type, t;
}
return e.type = "timeline", e;
}(Yt)
), Q$ = (
/** @class */
function(r) {
O(e, r);
function e(t, n, a, i) {
var o = r.call(this, t, n, a) || this;
return o.type = i || "value", o;
}
return e.prototype.getLabelModel = function() {
return this.model.getModel("label");
}, e.prototype.isHorizontal = function() {
return this.model.get("orient") === "horizontal";
}, e;
}(Br)
), Pp = Math.PI, Aw = bt(), J$ = (
/** @class */
function(r) {
O(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t.type = e.type, t;
}
return e.prototype.init = function(t, n) {
this.api = n;
}, e.prototype.render = function(t, n, a) {
if (this.model = t, this.api = a, this.ecModel = n, this.group.removeAll(), t.get("show", !0)) {
var i = this._layout(t, a), o = this._createGroup("_mainGroup"), s = this._createGroup("_labelGroup"), l = this._axis = this._createAxis(i, t);
t.formatTooltip = function(u) {
var h = l.scale.getLabel({
value: u
});
return pe("nameValue", {
noName: !0,
value: h
});
}, A(["AxisLine", "AxisTick", "Control", "CurrentPointer"], function(u) {
this["_render" + u](i, o, l, t);
}, this), this._renderAxisLabel(i, s, l, t), this._position(i, t);
}
this._doPlayStop(), this._updateTicksStatus();
}, e.prototype.remove = function() {
this._clearTimer(), this.group.removeAll();
}, e.prototype.dispose = function() {
this._clearTimer();
}, e.prototype._layout = function(t, n) {
var a = t.get(["label", "position"]), i = t.get("orient"), o = e9(t, n), s;
a == null || a === "auto" ? s = i === "horizontal" ? o.y + o.height / 2 < n.getHeight() / 2 ? "-" : "+" : o.x + o.width / 2 < n.getWidth() / 2 ? "+" : "-" : U(a) ? s = {
horizontal: {
top: "-",
bottom: "+"
},
vertical: {
left: "-",
right: "+"
}
}[i][a] : s = a;
var l = {
horizontal: "center",
vertical: s >= 0 || s === "+" ? "left" : "right"
}, u = {
horizontal: s >= 0 || s === "+" ? "top" : "bottom",
vertical: "middle"
}, h = {
horizontal: 0,
vertical: Pp / 2
}, f = i === "vertical" ? o.height : o.width, c = t.getModel("controlStyle"), v = c.get("show", !0), p = v ? c.get("itemSize") : 0, d = v ? c.get("itemGap") : 0, g = p + d, y = t.get(["label", "rotate"]) || 0;
y = y * Pp / 180;
var m, _, S, x = c.get("position", !0), b = v && c.get("showPlayBtn", !0), w = v && c.get("showPrevBtn", !0), T = v && c.get("showNextBtn", !0), C = 0, D = f;
x === "left" || x === "bottom" ? (b && (m = [0, 0], C += g), w && (_ = [C, 0], C += g), T && (S = [D - p, 0], D -= g)) : (b && (m = [D - p, 0], D -= g), w && (_ = [0, 0], C += g), T && (S = [D - p, 0], D -= g));
var M = [C, D];
return t.get("inverse") && M.reverse(), {
viewRect: o,
mainLength: f,
orient: i,
rotation: h[i],
labelRotation: y,
labelPosOpt: s,
labelAlign: t.get(["label", "align"]) || l[i],
labelBaseline: t.get(["label", "verticalAlign"]) || t.get(["label", "baseline"]) || u[i],
// Based on mainGroup.
playPosition: m,
prevBtnPosition: _,
nextBtnPosition: S,
axisExtent: M,
controlSize: p,
controlGap: d
};
}, e.prototype._position = function(t, n) {
var a = this._mainGroup, i = this._labelGroup, o = t.viewRect;
if (t.orient === "vertical") {
var s = tr(), l = o.x, u = o.y + o.height;
nn(s, s, [-l, -u]), Li(s, s, -Pp / 2), nn(s, s, [l, u]), o = o.clone(), o.applyTransform(s);
}
var h = m(o), f = m(a.getBoundingRect()), c = m(i.getBoundingRect()), v = [a.x, a.y], p = [i.x, i.y];
p[0] = v[0] = h[0][0];
var d = t.labelPosOpt;
if (d == null || U(d)) {
var g = d === "+" ? 0 : 1;
_(v, f, h, 1, g), _(p, c, h, 1, 1 - g);
} else {
var g = d >= 0 ? 0 : 1;
_(v, f, h, 1, g), p[1] = v[1] + d;
}
a.setPosition(v), i.setPosition(p), a.rotation = i.rotation = t.rotation, y(a), y(i);
function y(S) {
S.originX = h[0][0] - S.x, S.originY = h[1][0] - S.y;
}
function m(S) {
return [[S.x, S.x + S.width], [S.y, S.y + S.height]];
}
function _(S, x, b, w, T) {
S[w] += b[w][T] - x[w][T];
}
}, e.prototype._createAxis = function(t, n) {
var a = n.getData(), i = n.get("axisType"), o = t9(n, i);
o.getTicks = function() {
return a.mapArray(["value"], function(u) {
return {
value: u
};
});
};
var s = a.getDataExtent("value");
o.setExtent(s[0], s[1]), o.calcNiceTicks();
var l = new Q$("value", o, t.axisExtent, i);
return l.model = n, l;
}, e.prototype._createGroup = function(t) {
var n = this[t] = new at();
return this.group.add(n), n;
}, e.prototype._renderAxisLine = function(t, n, a, i) {
var o = a.getExtent();
if (i.get(["lineStyle", "show"])) {
var s = new he({
shape: {
x1: o[0],
y1: 0,
x2: o[1],
y2: 0
},
style: B({
lineCap: "round"
}, i.getModel("lineStyle").getLineStyle()),
silent: !0,
z2: 1
});
n.add(s);
var l = this._progressLine = new he({
shape: {
x1: o[0],
x2: this._currentPointer ? this._currentPointer.x : o[0],
y1: 0,
y2: 0
},
style: et({
lineCap: "round",
lineWidth: s.style.lineWidth
}, i.getModel(["progress", "lineStyle"]).getLineStyle()),
silent: !0,
z2: 1
});
n.add(l);
}
}, e.prototype._renderAxisTick = function(t, n, a, i) {
var o = this, s = i.getData(), l = a.scale.getTicks();
this._tickSymbols = [], A(l, function(u) {
var h = a.dataToCoord(u.value), f = s.getItemModel(u.value), c = f.getModel("itemStyle"), v = f.getModel(["emphasis", "itemStyle"]), p = f.getModel(["progress", "itemStyle"]), d = {
x: h,
y: 0,
onclick: Y(o._changeTimeline, o, u.value)
}, g = Mw(f, c, n, d);
g.ensureState("emphasis").style = v.getItemStyle(), g.ensureState("progress").style = p.getItemStyle(), vi(g);
var y = it(g);
f.get("tooltip") ? (y.dataIndex = u.value, y.dataModel = i) : y.dataIndex = y.dataModel = null, o._tickSymbols.push(g);
});
}, e.prototype._renderAxisLabel = function(t, n, a, i) {
var o = this, s = a.getLabelModel();
if (s.get("show")) {
var l = i.getData(), u = a.getViewLabels();
this._tickLabels = [], A(u, function(h) {
var f = h.tickValue, c = l.getItemModel(f), v = c.getModel("label"), p = c.getModel(["emphasis", "label"]), d = c.getModel(["progress", "label"]), g = a.dataToCoord(h.tickValue), y = new wt({
x: g,
y: 0,
rotation: t.labelRotation - t.rotation,
onclick: Y(o._changeTimeline, o, f),
silent: !1,
style: Gt(v, {
text: h.formattedLabel,
align: t.labelAlign,
verticalAlign: t.labelBaseline
})
});
y.ensureState("emphasis").style = Gt(p), y.ensureState("progress").style = Gt(d), n.add(y), vi(y), Aw(y).dataIndex = f, o._tickLabels.push(y);
});
}
}, e.prototype._renderControl = function(t, n, a, i) {
var o = t.controlSize, s = t.rotation, l = i.getModel("controlStyle").getItemStyle(), u = i.getModel(["emphasis", "controlStyle"]).getItemStyle(), h = i.getPlayState(), f = i.get("inverse", !0);
c(t.nextBtnPosition, "next", Y(this._changeTimeline, this, f ? "-" : "+")), c(t.prevBtnPosition, "prev", Y(this._changeTimeline, this, f ? "+" : "-")), c(t.playPosition, h ? "stop" : "play", Y(this._handlePlayClick, this, !h), !0);
function c(v, p, d, g) {
if (v) {
var y = Rr(ot(i.get(["controlStyle", p + "BtnSize"]), o), o), m = [0, -y / 2, y, y], _ = r9(i, p + "Icon", m, {
x: v[0],
y: v[1],
originX: o / 2,
originY: 0,
rotation: g ? -s : 0,
rectHover: !0,
style: l,
onclick: d
});
_.ensureState("emphasis").style = u, n.add(_), vi(_);
}
}
}, e.prototype._renderCurrentPointer = function(t, n, a, i) {
var o = i.getData(), s = i.getCurrentIndex(), l = o.getItemModel(s).getModel("checkpointStyle"), u = this, h = {
onCreate: function(f) {
f.draggable = !0, f.drift = Y(u._handlePointerDrag, u), f.ondragend = Y(u._handlePointerDragend, u), Iw(f, u._progressLine, s, a, i, !0);
},
onUpdate: function(f) {
Iw(f, u._progressLine, s, a, i);
}
};
this._currentPointer = Mw(l, l, this._mainGroup, {}, this._currentPointer, h);
}, e.prototype._handlePlayClick = function(t) {
this._clearTimer(), this.api.dispatchAction({
type: "timelinePlayChange",
playState: t,
from: this.uid
});
}, e.prototype._handlePointerDrag = function(t, n, a) {
this._clearTimer(), this._pointerChangeTimeline([a.offsetX, a.offsetY]);
}, e.prototype._handlePointerDragend = function(t) {
this._pointerChangeTimeline([t.offsetX, t.offsetY], !0);
}, e.prototype._pointerChangeTimeline = function(t, n) {
var a = this._toAxisCoord(t)[0], i = this._axis, o = yr(i.getExtent().slice());
a > o[1] && (a = o[1]), a < o[0] && (a = o[0]), this._currentPointer.x = a, this._currentPointer.markRedraw();
var s = this._progressLine;
s && (s.shape.x2 = a, s.dirty());
var l = this._findNearestTick(a), u = this.model;
(n || l !== u.getCurrentIndex() && u.get("realtime")) && this._changeTimeline(l);
}, e.prototype._doPlayStop = function() {
var t = this;
this._clearTimer(), this.model.getPlayState() && (this._timer = setTimeout(function() {
var n = t.model;
t._changeTimeline(n.getCurrentIndex() + (n.get("rewind", !0) ? -1 : 1));
}, this.model.get("playInterval")));
}, e.prototype._toAxisCoord = function(t) {
var n = this._mainGroup.getLocalTransform();
return kr(t, n, !0);
}, e.prototype._findNearestTick = function(t) {
var n = this.model.getData(), a = 1 / 0, i, o = this._axis;
return n.each(["value"], function(s, l) {
var u = o.dataToCoord(s), h = Math.abs(u - t);
h < a && (a = h, i = l);
}), i;
}, e.prototype._clearTimer = function() {
this._timer && (clearTimeout(this._timer), this._timer = null);
}, e.prototype._changeTimeline = function(t) {
var n = this.model.getCurrentIndex();
t === "+" ? t = n + 1 : t === "-" && (t = n - 1), this.api.dispatchAction({
type: "timelineChange",
currentIndex: t,
from: this.uid
});
}, e.prototype._updateTicksStatus = function() {
var t = this.model.getCurrentIndex(), n = this._tickSymbols, a = this._tickLabels;
if (n)
for (var i = 0; i < n.length; i++)
n && n[i] && n[i].toggleState("progress", i < t);
if (a)
for (var i = 0; i < a.length; i++)
a && a[i] && a[i].toggleState("progress", Aw(a[i]).dataIndex <= t);
}, e.type = "timeline.slider", e;
}(j$)
);
function t9(r, e) {
if (e = e || r.get("type"), e)
switch (e) {
// Buildin scale
case "category":
return new uc({
ordinalMeta: r.getCategories(),
extent: [1 / 0, -1 / 0]
});
case "time":
return new Yy({
locale: r.ecModel.getLocaleModel(),
useUTC: r.ecModel.get("useUTC")
});
default:
return new En();
}
}
function e9(r, e) {
return se(r.getBoxLayoutParams(), {
width: e.getWidth(),
height: e.getHeight()
}, r.get("padding"));
}
function r9(r, e, t, n) {
var a = n.style, i = Hl(r.get(["controlStyle", e]), n || {}, new ct(t[0], t[1], t[2], t[3]));
return a && i.setStyle(a), i;
}
function Mw(r, e, t, n, a, i) {
var o = e.get("color");
if (a)
a.setColor(o), t.add(a), i && i.onUpdate(a);
else {
var s = r.get("symbol");
a = ae(s, -1, -1, 2, 2, o), a.setStyle("strokeNoScale", !0), t.add(a), i && i.onCreate(a);
}
var l = e.getItemStyle(["color"]);
a.setStyle(l), n = ht({
rectHover: !0,
z2: 100
}, n, !0);
var u = qo(r.get("symbolSize"));
n.scaleX = u[0] / 2, n.scaleY = u[1] / 2;
var h = ki(r.get("symbolOffset"), u);
h && (n.x = (n.x || 0) + h[0], n.y = (n.y || 0) + h[1]);
var f = r.get("symbolRotate");
return n.rotation = (f || 0) * Math.PI / 180 || 0, a.attr(n), a.updateTransform(), a;
}
function Iw(r, e, t, n, a, i) {
if (!r.dragging) {
var o = a.getModel("checkpointStyle"), s = n.dataToCoord(a.getData().get("value", t));
if (i || !o.get("animation", !0))
r.attr({
x: s,
y: 0
}), e && e.attr({
shape: {
x2: s
}
});
else {
var l = {
duration: o.get("animationDuration", !0),
easing: o.get("animationEasing", !0)
};
r.stopAnimation(null, !0), r.animateTo({
x: s,
y: 0
}, l), e && e.animateTo({
shape: {
x2: s
}
}, l);
}
}
}
function n9(r) {
r.registerAction({
type: "timelineChange",
event: "timelineChanged",
update: "prepareAndUpdate"
}, function(e, t, n) {
var a = t.getComponent("timeline");
return a && e.currentIndex != null && (a.setCurrentIndex(e.currentIndex), !a.get("loop", !0) && a.isIndexMax() && a.getPlayState() && (a.setPlayState(!1), n.dispatchAction({
type: "timelinePlayChange",
playState: !1,
from: e.from
}))), t.resetOption("timeline", {
replaceMerge: a.get("replaceMerge", !0)
}), et({
currentIndex: a.option.currentIndex
}, e);
}), r.registerAction({
type: "timelinePlayChange",
event: "timelinePlayChanged",
update: "update"
}, function(e, t) {
var n = t.getComponent("timeline");
n && e.playState != null && n.setPlayState(e.playState);
});
}
function a9(r) {
var e = r && r.timeline;
z(e) || (e = e ? [e] : []), A(e, function(t) {
t && i9(t);
});
}
function i9(r) {
var e = r.type, t = {
number: "value",
time: "time"
};
if (t[e] && (r.axisType = t[e], delete r.type), Lw(r), ti(r, "controlPosition")) {
var n = r.controlStyle || (r.controlStyle = {});
ti(n, "position") || (n.position = r.controlPosition), n.position === "none" && !ti(n, "show") && (n.show = !1, delete n.position), delete r.controlPosition;
}
A(r.data || [], function(a) {
J(a) && !z(a) && (!ti(a, "value") && ti(a, "name") && (a.value = a.name), Lw(a));
});
}
function Lw(r) {
var e = r.itemStyle || (r.itemStyle = {}), t = e.emphasis || (e.emphasis = {}), n = r.label || r.label || {}, a = n.normal || (n.normal = {}), i = {
normal: 1,
emphasis: 1
};
A(n, function(o, s) {
!i[s] && !ti(a, s) && (a[s] = o);
}), t.label && !ti(n, "emphasis") && (n.emphasis = t.label, delete t.label);
}
function ti(r, e) {
return r.hasOwnProperty(e);
}
function o9(r) {
r.registerComponentModel(UI), r.registerComponentView(J$), r.registerSubTypeDefaulter("timeline", function() {
return "slider";
}), n9(r), r.registerPreprocessor(a9);
}
function Km(r, e) {
if (!r)
return !1;
for (var t = z(r) ? r : [r], n = 0; n < t.length; n++)
if (t[n] && t[n][e])
return !0;
return !1;
}
function ju(r) {
xi(r, "label", ["show"]);
}
var Qu = bt(), kn = (
/** @class */
function(r) {
O(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t.type = e.type, t.createdBySelf = !1, t;
}
return e.prototype.init = function(t, n, a) {
if (process.env.NODE_ENV !== "production" && this.type === "marker")
throw new Error("Marker component is abstract component. Use markLine, markPoint, markArea instead.");
this.mergeDefaultAndTheme(t, a), this._mergeOption(t, a, !1, !0);
}, e.prototype.isAnimationEnabled = function() {
if (yt.node)
return !1;
var t = this.__hostSeries;
return this.getShallow("animation") && t && t.isAnimationEnabled();
}, e.prototype.mergeOption = function(t, n) {
this._mergeOption(t, n, !1, !1);
}, e.prototype._mergeOption = function(t, n, a, i) {
var o = this.mainType;
a || n.eachSeries(function(s) {
var l = s.get(this.mainType, !0), u = Qu(s)[o];
if (!l || !l.data) {
Qu(s)[o] = null;
return;
}
u ? u._mergeOption(l, n, !0) : (i && ju(l), A(l.data, function(h) {
h instanceof Array ? (ju(h[0]), ju(h[1])) : ju(h);
}), u = this.createMarkerModelFromSeries(l, this, n), B(u, {
mainType: this.mainType,
// Use the same series index and name
seriesIndex: s.seriesIndex,
name: s.name,
createdBySelf: !0
}), u.__hostSeries = s), Qu(s)[o] = u;
}, this);
}, e.prototype.formatTooltip = function(t, n, a) {
var i = this.getData(), o = this.getRawValue(t), s = i.getName(t);
return pe("section", {
header: this.name,
blocks: [pe("nameValue", {
name: s,
value: o,
noName: !s,
noValue: o == null
})]
});
}, e.prototype.getData = function() {
return this._data;
}, e.prototype.setData = function(t) {
this._data = t;
}, e.prototype.getDataParams = function(t, n) {
var a = nc.prototype.getDataParams.call(this, t, n), i = this.__hostSeries;
return i && (a.seriesId = i.id, a.seriesName = i.name, a.seriesType = i.subType), a;
}, e.getMarkerModelFromSeries = function(t, n) {
return Qu(t)[n];
}, e.type = "marker", e.dependencies = ["series", "grid", "polar", "geo"], e;
}(_t)
);
ie(kn, nc.prototype);
var s9 = (
/** @class */
function(r) {
O(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t.type = e.type, t;
}
return e.prototype.createMarkerModelFromSeries = function(t, n, a) {
return new e(t, n, a);
}, e.type = "markPoint", e.defaultOption = {
// zlevel: 0,
z: 5,
symbol: "pin",
symbolSize: 50,
// symbolRotate: 0,
// symbolOffset: [0, 0]
tooltip: {
trigger: "item"
},
label: {
show: !0,
position: "inside"
},
itemStyle: {
borderWidth: 2
},
emphasis: {
label: {
show: !0
}
}
}, e;
}(kn)
);
function Eg(r) {
return !(isNaN(parseFloat(r.x)) && isNaN(parseFloat(r.y)));
}
function l9(r) {
return !isNaN(parseFloat(r.x)) && !isNaN(parseFloat(r.y));
}
function Ju(r, e, t, n, a, i) {
var o = [], s = da(
e,
n
/* , otherDataDim */
), l = s ? e.getCalculationInfo("stackResultDimension") : n, u = jm(e, l, r), h = e.indicesOfNearest(l, u)[0];
o[a] = e.get(t, h), o[i] = e.get(l, h);
var f = e.get(n, h), c = Kr(e.get(n, h));
return c = Math.min(c, 20), c >= 0 && (o[i] = +o[i].toFixed(c)), [o, f];
}
var kp = {
min: ut(Ju, "min"),
max: ut(Ju, "max"),
average: ut(Ju, "average"),
median: ut(Ju, "median")
};
function Ll(r, e) {
if (e) {
var t = r.getData(), n = r.coordinateSystem, a = n && n.dimensions;
if (!l9(e) && !z(e.coord) && z(a)) {
var i = YI(e, t, n, r);
if (e = nt(e), e.type && kp[e.type] && i.baseAxis && i.valueAxis) {
var o = pt(a, i.baseAxis.dim), s = pt(a, i.valueAxis.dim), l = kp[e.type](t, i.baseDataDim, i.valueDataDim, o, s);
e.coord = l[0], e.value = l[1];
} else
e.coord = [e.xAxis != null ? e.xAxis : e.radiusAxis, e.yAxis != null ? e.yAxis : e.angleAxis];
}
if (e.coord == null || !z(a))
e.coord = [];
else
for (var u = e.coord, h = 0; h < 2; h++)
kp[u[h]] && (u[h] = jm(t, t.mapDimension(a[h]), u[h]));
return e;
}
}
function YI(r, e, t, n) {
var a = {};
return r.valueIndex != null || r.valueDim != null ? (a.valueDataDim = r.valueIndex != null ? e.getDimension(r.valueIndex) : r.valueDim, a.valueAxis = t.getAxis(u9(n, a.valueDataDim)), a.baseAxis = t.getOtherAxis(a.valueAxis), a.baseDataDim = e.mapDimension(a.baseAxis.dim)) : (a.baseAxis = n.getBaseAxis(), a.valueAxis = t.getOtherAxis(a.baseAxis), a.baseDataDim = e.mapDimension(a.baseAxis.dim), a.valueDataDim = e.mapDimension(a.valueAxis.dim)), a;
}
function u9(r, e) {
var t = r.getData().getDimensionInfo(e);
return t && t.coordDim;
}
function El(r, e) {
return r && r.containData && e.coord && !Eg(e) ? r.containData(e.coord) : !0;
}
function h9(r, e, t) {
return r && r.containZone && e.coord && t.coord && !Eg(e) && !Eg(t) ? r.containZone(e.coord, t.coord) : !0;
}
function ZI(r, e) {
return r ? function(t, n, a, i) {
var o = i < 2 ? t.coord && t.coord[i] : t.value;
return sa(o, e[i]);
} : function(t, n, a, i) {
return sa(t.value, e[i]);
};
}
function jm(r, e, t) {
if (t === "average") {
var n = 0, a = 0;
return r.each(e, function(i, o) {
isNaN(i) || (n += i, a++);
}), n / a;
} else return t === "median" ? r.getMedian(e) : r.getDataExtent(e)[t === "max" ? 1 : 0];
}
var Rp = bt(), Qm = (
/** @class */
function(r) {
O(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t.type = e.type, t;
}
return e.prototype.init = function() {
this.markerGroupMap = X();
}, e.prototype.render = function(t, n, a) {
var i = this, o = this.markerGroupMap;
o.each(function(s) {
Rp(s).keep = !1;
}), n.eachSeries(function(s) {
var l = kn.getMarkerModelFromSeries(s, i.type);
l && i.renderSeries(s, l, n, a);
}), o.each(function(s) {
!Rp(s).keep && i.group.remove(s.group);
});
}, e.prototype.markKeep = function(t) {
Rp(t).keep = !0;
}, e.prototype.toggleBlurSeries = function(t, n) {
var a = this;
A(t, function(i) {
var o = kn.getMarkerModelFromSeries(i, a.type);
if (o) {
var s = o.getData();
s.eachItemGraphicEl(function(l) {
l && (n ? zC(l) : gy(l));
});
}
});
}, e.type = "marker", e;
}(Yt)
);
function Ew(r, e, t) {
var n = e.coordinateSystem;
r.each(function(a) {
var i = r.getItemModel(a), o, s = W(i.get("x"), t.getWidth()), l = W(i.get("y"), t.getHeight());
if (!isNaN(s) && !isNaN(l))
o = [s, l];
else if (e.getMarkerPosition)
o = e.getMarkerPosition(r.getValues(r.dimensions, a));
else if (n) {
var u = r.get(n.dimensions[0], a), h = r.get(n.dimensions[1], a);
o = n.dataToPoint([u, h]);
}
isNaN(s) || (o[0] = s), isNaN(l) || (o[1] = l), r.setItemLayout(a, o);
});
}
var f9 = (
/** @class */
function(r) {
O(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t.type = e.type, t;
}
return e.prototype.updateTransform = function(t, n, a) {
n.eachSeries(function(i) {
var o = kn.getMarkerModelFromSeries(i, "markPoint");
o && (Ew(o.getData(), i, a), this.markerGroupMap.get(i.id).updateLayout());
}, this);
}, e.prototype.renderSeries = function(t, n, a, i) {
var o = t.coordinateSystem, s = t.id, l = t.getData(), u = this.markerGroupMap, h = u.get(s) || u.set(s, new Zl()), f = c9(o, t, n);
n.setData(f), Ew(n.getData(), t, i), f.each(function(c) {
var v = f.getItemModel(c), p = v.getShallow("symbol"), d = v.getShallow("symbolSize"), g = v.getShallow("symbolRotate"), y = v.getShallow("symbolOffset"), m = v.getShallow("symbolKeepAspect");
if (K(p) || K(d) || K(g) || K(y)) {
var _ = n.getRawValue(c), S = n.getDataParams(c);
K(p) && (p = p(_, S)), K(d) && (d = d(_, S)), K(g) && (g = g(_, S)), K(y) && (y = y(_, S));
}
var x = v.getModel("itemStyle").getItemStyle(), b = Wl(l, "color");
x.fill || (x.fill = b), f.setItemVisual(c, {
symbol: p,
symbolSize: d,
symbolRotate: g,
symbolOffset: y,
symbolKeepAspect: m,
style: x
});
}), h.updateData(f), this.group.add(h.group), f.eachItemGraphicEl(function(c) {
c.traverse(function(v) {
it(v).dataModel = n;
});
}), this.markKeep(h), h.group.silent = n.get("silent") || t.get("silent");
}, e.type = "markPoint", e;
}(Qm)
);
function c9(r, e, t) {
var n;
r ? n = G(r && r.dimensions, function(s) {
var l = e.getData().getDimensionInfo(e.getData().mapDimension(s)) || {};
return B(B({}, l), {
name: s,
// DON'T use ordinalMeta to parse and collect ordinal.
ordinalMeta: null
});
}) : n = [{
name: "value",
type: "float"
}];
var a = new Ne(n, t), i = G(t.get("data"), ut(Ll, e));
r && (i = At(i, ut(El, r)));
var o = ZI(!!r, n);
return a.initData(i, null, o), a;
}
function v9(r) {
r.registerComponentModel(s9), r.registerComponentView(f9), r.registerPreprocessor(function(e) {
Km(e.series, "markPoint") && (e.markPoint = e.markPoint || {});
});
}
var p9 = (
/** @class */
function(r) {
O(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t.type = e.type, t;
}
return e.prototype.createMarkerModelFromSeries = function(t, n, a) {
return new e(t, n, a);
}, e.type = "markLine", e.defaultOption = {
// zlevel: 0,
z: 5,
symbol: ["circle", "arrow"],
symbolSize: [8, 16],
// symbolRotate: 0,
symbolOffset: 0,
precision: 2,
tooltip: {
trigger: "item"
},
label: {
show: !0,
position: "end",
distance: 5
},
lineStyle: {
type: "dashed"
},
emphasis: {
label: {
show: !0
},
lineStyle: {
width: 3
}
},
animationEasing: "linear"
}, e;
}(kn)
), th = bt(), d9 = function(r, e, t, n) {
var a = r.getData(), i;
if (z(n))
i = n;
else {
var o = n.type;
if (o === "min" || o === "max" || o === "average" || o === "median" || n.xAxis != null || n.yAxis != null) {
var s = void 0, l = void 0;
if (n.yAxis != null || n.xAxis != null)
s = e.getAxis(n.yAxis != null ? "y" : "x"), l = re(n.yAxis, n.xAxis);
else {
var u = YI(n, a, e, r);
s = u.valueAxis;
var h = BA(a, u.valueDataDim);
l = jm(a, h, o);
}
var f = s.dim === "x" ? 0 : 1, c = 1 - f, v = nt(n), p = {
coord: []
};
v.type = null, v.coord = [], v.coord[c] = -1 / 0, p.coord[c] = 1 / 0;
var d = t.get("precision");
d >= 0 && Tt(l) && (l = +l.toFixed(Math.min(d, 20))), v.coord[f] = p.coord[f] = l, i = [v, p, {
type: o,
valueIndex: n.valueIndex,
// Force to use the value of calculated value.
value: l
}];
} else
process.env.NODE_ENV !== "production" && Er("Invalid markLine data."), i = [];
}
var g = [Ll(r, i[0]), Ll(r, i[1]), B({}, i[2])];
return g[2].type = g[2].type || null, ht(g[2], g[0]), ht(g[2], g[1]), g;
};
function Sf(r) {
return !isNaN(r) && !isFinite(r);
}
function Pw(r, e, t, n) {
var a = 1 - r, i = n.dimensions[r];
return Sf(e[a]) && Sf(t[a]) && e[r] === t[r] && n.getAxis(i).containData(e[r]);
}
function g9(r, e) {
if (r.type === "cartesian2d") {
var t = e[0].coord, n = e[1].coord;
if (t && n && (Pw(1, t, n, r) || Pw(0, t, n, r)))
return !0;
}
return El(r, e[0]) && El(r, e[1]);
}
function Np(r, e, t, n, a) {
var i = n.coordinateSystem, o = r.getItemModel(e), s, l = W(o.get("x"), a.getWidth()), u = W(o.get("y"), a.getHeight());
if (!isNaN(l) && !isNaN(u))
s = [l, u];
else {
if (n.getMarkerPosition)
s = n.getMarkerPosition(r.getValues(r.dimensions, e));
else {
var h = i.dimensions, f = r.get(h[0], e), c = r.get(h[1], e);
s = i.dataToPoint([f, c]);
}
if (Ni(i, "cartesian2d")) {
var v = i.getAxis("x"), p = i.getAxis("y"), h = i.dimensions;
Sf(r.get(h[0], e)) ? s[0] = v.toGlobalCoord(v.getExtent()[t ? 0 : 1]) : Sf(r.get(h[1], e)) && (s[1] = p.toGlobalCoord(p.getExtent()[t ? 0 : 1]));
}
isNaN(l) || (s[0] = l), isNaN(u) || (s[1] = u);
}
r.setItemLayout(e, s);
}
var y9 = (
/** @class */
function(r) {
O(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t.type = e.type, t;
}
return e.prototype.updateTransform = function(t, n, a) {
n.eachSeries(function(i) {
var o = kn.getMarkerModelFromSeries(i, "markLine");
if (o) {
var s = o.getData(), l = th(o).from, u = th(o).to;
l.each(function(h) {
Np(l, h, !0, i, a), Np(u, h, !1, i, a);
}), s.each(function(h) {
s.setItemLayout(h, [l.getItemLayout(h), u.getItemLayout(h)]);
}), this.markerGroupMap.get(i.id).updateLayout();
}
}, this);
}, e.prototype.renderSeries = function(t, n, a, i) {
var o = t.coordinateSystem, s = t.id, l = t.getData(), u = this.markerGroupMap, h = u.get(s) || u.set(s, new _m());
this.group.add(h.group);
var f = m9(o, t, n), c = f.from, v = f.to, p = f.line;
th(n).from = c, th(n).to = v, n.setData(p);
var d = n.get("symbol"), g = n.get("symbolSize"), y = n.get("symbolRotate"), m = n.get("symbolOffset");
z(d) || (d = [d, d]), z(g) || (g = [g, g]), z(y) || (y = [y, y]), z(m) || (m = [m, m]), f.from.each(function(S) {
_(c, S, !0), _(v, S, !1);
}), p.each(function(S) {
var x = p.getItemModel(S).getModel("lineStyle").getLineStyle();
p.setItemLayout(S, [c.getItemLayout(S), v.getItemLayout(S)]), x.stroke == null && (x.stroke = c.getItemVisual(S, "style").fill), p.setItemVisual(S, {
fromSymbolKeepAspect: c.getItemVisual(S, "symbolKeepAspect"),
fromSymbolOffset: c.getItemVisual(S, "symbolOffset"),
fromSymbolRotate: c.getItemVisual(S, "symbolRotate"),
fromSymbolSize: c.getItemVisual(S, "symbolSize"),
fromSymbol: c.getItemVisual(S, "symbol"),
toSymbolKeepAspect: v.getItemVisual(S, "symbolKeepAspect"),
toSymbolOffset: v.getItemVisual(S, "symbolOffset"),
toSymbolRotate: v.getItemVisual(S, "symbolRotate"),
toSymbolSize: v.getItemVisual(S, "symbolSize"),
toSymbol: v.getItemVisual(S, "symbol"),
style: x
});
}), h.updateData(p), f.line.eachItemGraphicEl(function(S) {
it(S).dataModel = n, S.traverse(function(x) {
it(x).dataModel = n;
});
});
function _(S, x, b) {
var w = S.getItemModel(x);
Np(S, x, b, t, i);
var T = w.getModel("itemStyle").getItemStyle();
T.fill == null && (T.fill = Wl(l, "color")), S.setItemVisual(x, {
symbolKeepAspect: w.get("symbolKeepAspect"),
// `0` should be considered as a valid value, so use `retrieve2` instead of `||`
symbolOffset: ot(w.get("symbolOffset", !0), m[b ? 0 : 1]),
symbolRotate: ot(w.get("symbolRotate", !0), y[b ? 0 : 1]),
// TODO: when 2d array is supported, it should ignore parent
symbolSize: ot(w.get("symbolSize"), g[b ? 0 : 1]),
symbol: ot(w.get("symbol", !0), d[b ? 0 : 1]),
style: T
});
}
this.markKeep(h), h.group.silent = n.get("silent") || t.get("silent");
}, e.type = "markLine", e;
}(Qm)
);
function m9(r, e, t) {
var n;
r ? n = G(r && r.dimensions, function(u) {
var h = e.getData().getDimensionInfo(e.getData().mapDimension(u)) || {};
return B(B({}, h), {
name: u,
// DON'T use ordinalMeta to parse and collect ordinal.
ordinalMeta: null
});
}) : n = [{
name: "value",
type: "float"
}];
var a = new Ne(n, t), i = new Ne(n, t), o = new Ne([], t), s = G(t.get("data"), ut(d9, e, r, t));
r && (s = At(s, ut(g9, r)));
var l = ZI(!!r, n);
return a.initData(G(s, function(u) {
return u[0];
}), null, l), i.initData(G(s, function(u) {
return u[1];
}), null, l), o.initData(G(s, function(u) {
return u[2];
})), o.hasItemOption = !0, {
from: a,
to: i,
line: o
};
}
function _9(r) {
r.registerComponentModel(p9), r.registerComponentView(y9), r.registerPreprocessor(function(e) {
Km(e.series, "markLine") && (e.markLine = e.markLine || {});
});
}
var S9 = (
/** @class */
function(r) {
O(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t.type = e.type, t;
}
return e.prototype.createMarkerModelFromSeries = function(t, n, a) {
return new e(t, n, a);
}, e.type = "markArea", e.defaultOption = {
// zlevel: 0,
// PENDING
z: 1,
tooltip: {
trigger: "item"
},
// markArea should fixed on the coordinate system
animation: !1,
label: {
show: !0,
position: "top"
},
itemStyle: {
// color and borderColor default to use color from series
// color: 'auto'
// borderColor: 'auto'
borderWidth: 0
},
emphasis: {
label: {
show: !0,
position: "top"
}
}
}, e;
}(kn)
), eh = bt(), x9 = function(r, e, t, n) {
var a = n[0], i = n[1];
if (!(!a || !i)) {
var o = Ll(r, a), s = Ll(r, i), l = o.coord, u = s.coord;
l[0] = re(l[0], -1 / 0), l[1] = re(l[1], -1 / 0), u[0] = re(u[0], 1 / 0), u[1] = re(u[1], 1 / 0);
var h = Qg([{}, o, s]);
return h.coord = [o.coord, s.coord], h.x0 = o.x, h.y0 = o.y, h.x1 = s.x, h.y1 = s.y, h;
}
};
function xf(r) {
return !isNaN(r) && !isFinite(r);
}
function kw(r, e, t, n) {
var a = 1 - r;
return xf(e[a]) && xf(t[a]);
}
function b9(r, e) {
var t = e.coord[0], n = e.coord[1], a = {
coord: t,
x: e.x0,
y: e.y0
}, i = {
coord: n,
x: e.x1,
y: e.y1
};
return Ni(r, "cartesian2d") ? t && n && (kw(1, t, n) || kw(0, t, n)) ? !0 : h9(r, a, i) : El(r, a) || El(r, i);
}
function Rw(r, e, t, n, a) {
var i = n.coordinateSystem, o = r.getItemModel(e), s, l = W(o.get(t[0]), a.getWidth()), u = W(o.get(t[1]), a.getHeight());
if (!isNaN(l) && !isNaN(u))
s = [l, u];
else {
if (n.getMarkerPosition) {
var h = r.getValues(["x0", "y0"], e), f = r.getValues(["x1", "y1"], e), c = i.clampData(h), v = i.clampData(f), p = [];
t[0] === "x0" ? p[0] = c[0] > v[0] ? f[0] : h[0] : p[0] = c[0] > v[0] ? h[0] : f[0], t[1] === "y0" ? p[1] = c[1] > v[1] ? f[1] : h[1] : p[1] = c[1] > v[1] ? h[1] : f[1], s = n.getMarkerPosition(p, t, !0);
} else {
var d = r.get(t[0], e), g = r.get(t[1], e), y = [d, g];
i.clampData && i.clampData(y, y), s = i.dataToPoint(y, !0);
}
if (Ni(i, "cartesian2d")) {
var m = i.getAxis("x"), _ = i.getAxis("y"), d = r.get(t[0], e), g = r.get(t[1], e);
xf(d) ? s[0] = m.toGlobalCoord(m.getExtent()[t[0] === "x0" ? 0 : 1]) : xf(g) && (s[1] = _.toGlobalCoord(_.getExtent()[t[1] === "y0" ? 0 : 1]));
}
isNaN(l) || (s[0] = l), isNaN(u) || (s[1] = u);
}
return s;
}
var Nw = [["x0", "y0"], ["x1", "y0"], ["x1", "y1"], ["x0", "y1"]], w9 = (
/** @class */
function(r) {
O(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t.type = e.type, t;
}
return e.prototype.updateTransform = function(t, n, a) {
n.eachSeries(function(i) {
var o = kn.getMarkerModelFromSeries(i, "markArea");
if (o) {
var s = o.getData();
s.each(function(l) {
var u = G(Nw, function(f) {
return Rw(s, l, f, i, a);
});
s.setItemLayout(l, u);
var h = s.getItemGraphicEl(l);
h.setShape("points", u);
});
}
}, this);
}, e.prototype.renderSeries = function(t, n, a, i) {
var o = t.coordinateSystem, s = t.id, l = t.getData(), u = this.markerGroupMap, h = u.get(s) || u.set(s, {
group: new at()
});
this.group.add(h.group), this.markKeep(h);
var f = T9(o, t, n);
n.setData(f), f.each(function(c) {
var v = G(Nw, function(T) {
return Rw(f, c, T, t, i);
}), p = o.getAxis("x").scale, d = o.getAxis("y").scale, g = p.getExtent(), y = d.getExtent(), m = [p.parse(f.get("x0", c)), p.parse(f.get("x1", c))], _ = [d.parse(f.get("y0", c)), d.parse(f.get("y1", c))];
yr(m), yr(_);
var S = !(g[0] > m[1] || g[1] < m[0] || y[0] > _[1] || y[1] < _[0]), x = !S;
f.setItemLayout(c, {
points: v,
allClipped: x
});
var b = f.getItemModel(c).getModel("itemStyle").getItemStyle(), w = Wl(l, "color");
b.fill || (b.fill = w, U(b.fill) && (b.fill = Ph(b.fill, 0.4))), b.stroke || (b.stroke = w), f.setItemVisual(c, "style", b);
}), f.diff(eh(h).data).add(function(c) {
var v = f.getItemLayout(c);
if (!v.allClipped) {
var p = new Fe({
shape: {
points: v.points
}
});
f.setItemGraphicEl(c, p), h.group.add(p);
}
}).update(function(c, v) {
var p = eh(h).data.getItemGraphicEl(v), d = f.getItemLayout(c);
d.allClipped ? p && h.group.remove(p) : (p ? Ct(p, {
shape: {
points: d.points
}
}, n, c) : p = new Fe({
shape: {
points: d.points
}
}), f.setItemGraphicEl(c, p), h.group.add(p));
}).remove(function(c) {
var v = eh(h).data.getItemGraphicEl(c);
h.group.remove(v);
}).execute(), f.eachItemGraphicEl(function(c, v) {
var p = f.getItemModel(v), d = f.getItemVisual(v, "style");
c.useStyle(f.getItemVisual(v, "style")), xe(c, ve(p), {
labelFetcher: n,
labelDataIndex: v,
defaultText: f.getName(v) || "",
inheritColor: U(d.fill) ? Ph(d.fill, 1) : "#000"
}), Se(c, p), Xt(c, null, null, p.get(["emphasis", "disabled"])), it(c).dataModel = n;
}), eh(h).data = f, h.group.silent = n.get("silent") || t.get("silent");
}, e.type = "markArea", e;
}(Qm)
);
function T9(r, e, t) {
var n, a, i = ["x0", "y0", "x1", "y1"];
if (r) {
var o = G(r && r.dimensions, function(u) {
var h = e.getData(), f = h.getDimensionInfo(h.mapDimension(u)) || {};
return B(B({}, f), {
name: u,
// DON'T use ordinalMeta to parse and collect ordinal.
ordinalMeta: null
});
});
a = G(i, function(u, h) {
return {
name: u,
type: o[h % 2].type
};
}), n = new Ne(a, t);
} else
a = [{
name: "value",
type: "float"
}], n = new Ne(a, t);
var s = G(t.get("data"), ut(x9, e, r, t));
r && (s = At(s, ut(b9, r)));
var l = r ? function(u, h, f, c) {
var v = u.coord[Math.floor(c / 2)][c % 2];
return sa(v, a[c]);
} : function(u, h, f, c) {
return sa(u.value, a[c]);
};
return n.initData(s, null, l), n.hasItemOption = !0, n;
}
function C9(r) {
r.registerComponentModel(S9), r.registerComponentView(w9), r.registerPreprocessor(function(e) {
Km(e.series, "markArea") && (e.markArea = e.markArea || {});
});
}
var D9 = function(r, e) {
if (e === "all")
return {
type: "all",
title: r.getLocaleModel().get(["legend", "selector", "all"])
};
if (e === "inverse")
return {
type: "inverse",
title: r.getLocaleModel().get(["legend", "selector", "inverse"])
};
}, Pg = (
/** @class */
function(r) {
O(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t.type = e.type, t.layoutMode = {
type: "box",
// legend.width/height are maxWidth/maxHeight actually,
// whereas real width/height is calculated by its content.
// (Setting {left: 10, right: 10} does not make sense).
// So consider the case:
// `setOption({legend: {left: 10});`
// then `setOption({legend: {right: 10});`
// The previous `left` should be cleared by setting `ignoreSize`.
ignoreSize: !0
}, t;
}
return e.prototype.init = function(t, n, a) {
this.mergeDefaultAndTheme(t, a), t.selected = t.selected || {}, this._updateSelector(t);
}, e.prototype.mergeOption = function(t, n) {
r.prototype.mergeOption.call(this, t, n), this._updateSelector(t);
}, e.prototype._updateSelector = function(t) {
var n = t.selector, a = this.ecModel;
n === !0 && (n = t.selector = ["all", "inverse"]), z(n) && A(n, function(i, o) {
U(i) && (i = {
type: i
}), n[o] = ht(i, D9(a, i.type));
});
}, e.prototype.optionUpdated = function() {
this._updateData(this.ecModel);
var t = this._data;
if (t[0] && this.get("selectedMode") === "single") {
for (var n = !1, a = 0; a < t.length; a++) {
var i = t[a].get("name");
if (this.isSelected(i)) {
this.select(i), n = !0;
break;
}
}
!n && this.select(t[0].get("name"));
}
}, e.prototype._updateData = function(t) {
var n = [], a = [];
t.eachRawSeries(function(l) {
var u = l.name;
a.push(u);
var h;
if (l.legendVisualProvider) {
var f = l.legendVisualProvider, c = f.getAllNames();
t.isSeriesFiltered(l) || (a = a.concat(c)), c.length ? n = n.concat(c) : h = !0;
} else
h = !0;
h && ly(l) && n.push(l.name);
}), this._availableNames = a;
var i = this.get("data") || n, o = X(), s = G(i, function(l) {
return (U(l) || Tt(l)) && (l = {
name: l
}), o.get(l.name) ? null : (o.set(l.name, !0), new It(l, this, this.ecModel));
}, this);
this._data = At(s, function(l) {
return !!l;
});
}, e.prototype.getData = function() {
return this._data;
}, e.prototype.select = function(t) {
var n = this.option.selected, a = this.get("selectedMode");
if (a === "single") {
var i = this._data;
A(i, function(o) {
n[o.get("name")] = !1;
});
}
n[t] = !0;
}, e.prototype.unSelect = function(t) {
this.get("selectedMode") !== "single" && (this.option.selected[t] = !1);
}, e.prototype.toggleSelected = function(t) {
var n = this.option.selected;
n.hasOwnProperty(t) || (n[t] = !0), this[n[t] ? "unSelect" : "select"](t);
}, e.prototype.allSelect = function() {
var t = this._data, n = this.option.selected;
A(t, function(a) {
n[a.get("name", !0)] = !0;
});
}, e.prototype.inverseSelect = function() {
var t = this._data, n = this.option.selected;
A(t, function(a) {
var i = a.get("name", !0);
n.hasOwnProperty(i) || (n[i] = !0), n[i] = !n[i];
});
}, e.prototype.isSelected = function(t) {
var n = this.option.selected;
return !(n.hasOwnProperty(t) && !n[t]) && pt(this._availableNames, t) >= 0;
}, e.prototype.getOrient = function() {
return this.get("orient") === "vertical" ? {
index: 1,
name: "vertical"
} : {
index: 0,
name: "horizontal"
};
}, e.type = "legend.plain", e.dependencies = ["series"], e.defaultOption = {
// zlevel: 0,
z: 4,
show: !0,
orient: "horizontal",
left: "center",
// right: 'center',
top: 0,
// bottom: null,
align: "auto",
backgroundColor: "rgba(0,0,0,0)",
borderColor: "#ccc",
borderRadius: 0,
borderWidth: 0,
padding: 5,
itemGap: 10,
itemWidth: 25,
itemHeight: 14,
symbolRotate: "inherit",
symbolKeepAspect: !0,
inactiveColor: "#ccc",
inactiveBorderColor: "#ccc",
inactiveBorderWidth: "auto",
itemStyle: {
color: "inherit",
opacity: "inherit",
borderColor: "inherit",
borderWidth: "auto",
borderCap: "inherit",
borderJoin: "inherit",
borderDashOffset: "inherit",
borderMiterLimit: "inherit"
},
lineStyle: {
width: "auto",
color: "inherit",
inactiveColor: "#ccc",
inactiveWidth: 2,
opacity: "inherit",
type: "inherit",
cap: "inherit",
join: "inherit",
dashOffset: "inherit",
miterLimit: "inherit"
},
textStyle: {
color: "#333"
},
selectedMode: !0,
selector: !1,
selectorLabel: {
show: !0,
borderRadius: 10,
padding: [3, 5, 3, 5],
fontSize: 12,
fontFamily: "sans-serif",
color: "#666",
borderWidth: 1,
borderColor: "#666"
},
emphasis: {
selectorLabel: {
show: !0,
color: "#eee",
backgroundColor: "#666"
}
},
selectorPosition: "auto",
selectorItemGap: 7,
selectorButtonGap: 10,
tooltip: {
show: !1
}
}, e;
}(_t)
), ao = ut, kg = A, rh = at, XI = (
/** @class */
function(r) {
O(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t.type = e.type, t.newlineDisabled = !1, t;
}
return e.prototype.init = function() {
this.group.add(this._contentGroup = new rh()), this.group.add(this._selectorGroup = new rh()), this._isFirstRender = !0;
}, e.prototype.getContentGroup = function() {
return this._contentGroup;
}, e.prototype.getSelectorGroup = function() {
return this._selectorGroup;
}, e.prototype.render = function(t, n, a) {
var i = this._isFirstRender;
if (this._isFirstRender = !1, this.resetInner(), !!t.get("show", !0)) {
var o = t.get("align"), s = t.get("orient");
(!o || o === "auto") && (o = t.get("left") === "right" && s === "vertical" ? "right" : "left");
var l = t.get("selector", !0), u = t.get("selectorPosition", !0);
l && (!u || u === "auto") && (u = s === "horizontal" ? "end" : "start"), this.renderInner(o, t, n, a, l, s, u);
var h = t.getBoxLayoutParams(), f = {
width: a.getWidth(),
height: a.getHeight()
}, c = t.get("padding"), v = se(h, f, c), p = this.layoutInner(t, o, v, i, l, u), d = se(et({
width: p.width,
height: p.height
}, h), f, c);
this.group.x = d.x - p.x, this.group.y = d.y - p.y, this.group.markRedraw(), this.group.add(this._backgroundEl = OI(p, t));
}
}, e.prototype.resetInner = function() {
this.getContentGroup().removeAll(), this._backgroundEl && this.group.remove(this._backgroundEl), this.getSelectorGroup().removeAll();
}, e.prototype.renderInner = function(t, n, a, i, o, s, l) {
var u = this.getContentGroup(), h = X(), f = n.get("selectedMode"), c = [];
a.eachRawSeries(function(v) {
!v.get("legendHoverLink") && c.push(v.id);
}), kg(n.getData(), function(v, p) {
var d = v.get("name");
if (!this.newlineDisabled && (d === "" || d === `
`)) {
var g = new rh();
g.newline = !0, u.add(g);
return;
}
var y = a.getSeriesByName(d)[0];
if (!h.get(d)) {
if (y) {
var m = y.getData(), _ = m.getVisual("legendLineStyle") || {}, S = m.getVisual("legendIcon"), x = m.getVisual("style"), b = this._createItem(y, d, p, v, n, t, _, x, S, f, i);
b.on("click", ao(Ow, d, null, i, c)).on("mouseover", ao(Rg, y.name, null, i, c)).on("mouseout", ao(Ng, y.name, null, i, c)), a.ssr && b.eachChild(function(w) {
var T = it(w);
T.seriesIndex = y.seriesIndex, T.dataIndex = p, T.ssrType = "legend";
}), h.set(d, !0);
} else
a.eachRawSeries(function(w) {
if (!h.get(d) && w.legendVisualProvider) {
var T = w.legendVisualProvider;
if (!T.containName(d))
return;
var C = T.indexOfName(d), D = T.getItemVisual(C, "style"), M = T.getItemVisual(C, "legendIcon"), I = er(D.fill);
I && I[3] === 0 && (I[3] = 0.2, D = B(B({}, D), {
fill: bn(I, "rgba")
}));
var L = this._createItem(w, d, p, v, n, t, {}, D, M, f, i);
L.on("click", ao(Ow, null, d, i, c)).on("mouseover", ao(Rg, null, d, i, c)).on("mouseout", ao(Ng, null, d, i, c)), a.ssr && L.eachChild(function(E) {
var P = it(E);
P.seriesIndex = w.seriesIndex, P.dataIndex = p, P.ssrType = "legend";
}), h.set(d, !0);
}
}, this);
process.env.NODE_ENV !== "production" && (h.get(d) || console.warn(d + " series not exists. Legend data should be same with series name or data name."));
}
}, this), o && this._createSelector(o, n, i, s, l);
}, e.prototype._createSelector = function(t, n, a, i, o) {
var s = this.getSelectorGroup();
kg(t, function(u) {
var h = u.type, f = new wt({
style: {
x: 0,
y: 0,
align: "center",
verticalAlign: "middle"
},
onclick: function() {
a.dispatchAction({
type: h === "all" ? "legendAllSelect" : "legendInverseSelect",
legendId: n.id
});
}
});
s.add(f);
var c = n.getModel("selectorLabel"), v = n.getModel(["emphasis", "selectorLabel"]);
xe(f, {
normal: c,
emphasis: v
}, {
defaultText: u.title
}), vi(f);
});
}, e.prototype._createItem = function(t, n, a, i, o, s, l, u, h, f, c) {
var v = t.visualDrawType, p = o.get("itemWidth"), d = o.get("itemHeight"), g = o.isSelected(n), y = i.get("symbolRotate"), m = i.get("symbolKeepAspect"), _ = i.get("icon");
h = _ || h || "roundRect";
var S = A9(h, i, l, u, v, g, c), x = new rh(), b = i.getModel("textStyle");
if (K(t.getLegendIcon) && (!_ || _ === "inherit"))
x.add(t.getLegendIcon({
itemWidth: p,
itemHeight: d,
icon: h,
iconRotate: y,
itemStyle: S.itemStyle,
lineStyle: S.lineStyle,
symbolKeepAspect: m
}));
else {
var w = _ === "inherit" && t.getData().getVisual("symbol") ? y === "inherit" ? t.getData().getVisual("symbolRotate") : y : 0;
x.add(M9({
itemWidth: p,
itemHeight: d,
icon: h,
iconRotate: w,
itemStyle: S.itemStyle,
symbolKeepAspect: m
}));
}
var T = s === "left" ? p + 5 : -5, C = s, D = o.get("formatter"), M = n;
U(D) && D ? M = D.replace("{name}", n ?? "") : K(D) && (M = D(n));
var I = g ? b.getTextColor() : i.get("inactiveColor");
x.add(new wt({
style: Gt(b, {
text: M,
x: T,
y: d / 2,
fill: I,
align: C,
verticalAlign: "middle"
}, {
inheritColor: I
})
}));
var L = new xt({
shape: x.getBoundingRect(),
style: {
// Cannot use 'invisible' because SVG SSR will miss the node
fill: "transparent"
}
}), E = i.getModel("tooltip");
return E.get("show") && Ei({
el: L,
componentModel: o,
itemName: n,
itemTooltipOption: E.option
}), x.add(L), x.eachChild(function(P) {
P.silent = !0;
}), L.silent = !f, this.getContentGroup().add(x), vi(x), x.__legendDataIndex = a, x;
}, e.prototype.layoutInner = function(t, n, a, i, o, s) {
var l = this.getContentGroup(), u = this.getSelectorGroup();
di(t.get("orient"), l, t.get("itemGap"), a.width, a.height);
var h = l.getBoundingRect(), f = [-h.x, -h.y];
if (u.markRedraw(), l.markRedraw(), o) {
di(
// Buttons in selectorGroup always layout horizontally
"horizontal",
u,
t.get("selectorItemGap", !0)
);
var c = u.getBoundingRect(), v = [-c.x, -c.y], p = t.get("selectorButtonGap", !0), d = t.getOrient().index, g = d === 0 ? "width" : "height", y = d === 0 ? "height" : "width", m = d === 0 ? "y" : "x";
s === "end" ? v[d] += h[g] + p : f[d] += c[g] + p, v[1 - d] += h[y] / 2 - c[y] / 2, u.x = v[0], u.y = v[1], l.x = f[0], l.y = f[1];
var _ = {
x: 0,
y: 0
};
return _[g] = h[g] + p + c[g], _[y] = Math.max(h[y], c[y]), _[m] = Math.min(0, c[m] + v[1 - d]), _;
} else
return l.x = f[0], l.y = f[1], this.group.getBoundingRect();
}, e.prototype.remove = function() {
this.getContentGroup().removeAll(), this._isFirstRender = !0;
}, e.type = "legend.plain", e;
}(Yt)
);
function A9(r, e, t, n, a, i, o) {
function s(g, y) {
g.lineWidth === "auto" && (g.lineWidth = y.lineWidth > 0 ? 2 : 0), kg(g, function(m, _) {
g[_] === "inherit" && (g[_] = y[_]);
});
}
var l = e.getModel("itemStyle"), u = l.getItemStyle(), h = r.lastIndexOf("empty", 0) === 0 ? "fill" : "stroke", f = l.getShallow("decal");
u.decal = !f || f === "inherit" ? n.decal : Mo(f, o), u.fill === "inherit" && (u.fill = n[a]), u.stroke === "inherit" && (u.stroke = n[h]), u.opacity === "inherit" && (u.opacity = (a === "fill" ? n : t).opacity), s(u, n);
var c = e.getModel("lineStyle"), v = c.getLineStyle();
if (s(v, t), u.fill === "auto" && (u.fill = n.fill), u.stroke === "auto" && (u.stroke = n.fill), v.stroke === "auto" && (v.stroke = n.fill), !i) {
var p = e.get("inactiveBorderWidth"), d = u[h];
u.lineWidth = p === "auto" ? n.lineWidth > 0 && d ? 2 : 0 : u.lineWidth, u.fill = e.get("inactiveColor"), u.stroke = e.get("inactiveBorderColor"), v.stroke = c.get("inactiveColor"), v.lineWidth = c.get("inactiveWidth");
}
return {
itemStyle: u,
lineStyle: v
};
}
function M9(r) {
var e = r.icon || "roundRect", t = ae(e, 0, 0, r.itemWidth, r.itemHeight, r.itemStyle.fill, r.symbolKeepAspect);
return t.setStyle(r.itemStyle), t.rotation = (r.iconRotate || 0) * Math.PI / 180, t.setOrigin([r.itemWidth / 2, r.itemHeight / 2]), e.indexOf("empty") > -1 && (t.style.stroke = t.style.fill, t.style.fill = "#fff", t.style.lineWidth = 2), t;
}
function Ow(r, e, t, n) {
Ng(r, e, t, n), t.dispatchAction({
type: "legendToggleSelect",
name: r ?? e
}), Rg(r, e, t, n);
}
function qI(r) {
for (var e = r.getZr().storage.getDisplayList(), t, n = 0, a = e.length; n < a && !(t = e[n].states.emphasis); )
n++;
return t && t.hoverLayer;
}
function Rg(r, e, t, n) {
qI(t) || t.dispatchAction({
type: "highlight",
seriesName: r,
name: e,
excludeSeriesId: n
});
}
function Ng(r, e, t, n) {
qI(t) || t.dispatchAction({
type: "downplay",
seriesName: r,
name: e,
excludeSeriesId: n
});
}
function I9(r) {
var e = r.findComponents({
mainType: "legend"
});
e && e.length && r.filterSeries(function(t) {
for (var n = 0; n < e.length; n++)
if (!e[n].isSelected(t.name))
return !1;
return !0;
});
}
function As(r, e, t) {
var n = r === "allSelect" || r === "inverseSelect", a = {}, i = [];
t.eachComponent({
mainType: "legend",
query: e
}, function(s) {
n ? s[r]() : s[r](e.name), Vw(s, a), i.push(s.componentIndex);
});
var o = {};
return t.eachComponent("legend", function(s) {
A(a, function(l, u) {
s[l ? "select" : "unSelect"](u);
}), Vw(s, o);
}), n ? {
selected: o,
// return legendIndex array to tell the developers which legends are allSelect / inverseSelect
legendIndex: i
} : {
name: e.name,
selected: o
};
}
function Vw(r, e) {
var t = e || {};
return A(r.getData(), function(n) {
var a = n.get("name");
if (!(a === `
` || a === "")) {
var i = r.isSelected(a);
Z(t, a) ? t[a] = t[a] && i : t[a] = i;
}
}), t;
}
function L9(r) {
r.registerAction("legendToggleSelect", "legendselectchanged", ut(As, "toggleSelected")), r.registerAction("legendAllSelect", "legendselectall", ut(As, "allSelect")), r.registerAction("legendInverseSelect", "legendinverseselect", ut(As, "inverseSelect")), r.registerAction("legendSelect", "legendselected", ut(As, "select")), r.registerAction("legendUnSelect", "legendunselected", ut(As, "unSelect"));
}
function KI(r) {
r.registerComponentModel(Pg), r.registerComponentView(XI), r.registerProcessor(r.PRIORITY.PROCESSOR.SERIES_FILTER, I9), r.registerSubTypeDefaulter("legend", function() {
return "plain";
}), L9(r);
}
var E9 = (
/** @class */
function(r) {
O(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t.type = e.type, t;
}
return e.prototype.setScrollDataIndex = function(t) {
this.option.scrollDataIndex = t;
}, e.prototype.init = function(t, n, a) {
var i = $o(t);
r.prototype.init.call(this, t, n, a), Bw(this, t, i);
}, e.prototype.mergeOption = function(t, n) {
r.prototype.mergeOption.call(this, t, n), Bw(this, this.option, t);
}, e.type = "legend.scroll", e.defaultOption = _a(Pg.defaultOption, {
scrollDataIndex: 0,
pageButtonItemGap: 5,
pageButtonGap: null,
pageButtonPosition: "end",
pageFormatter: "{current}/{total}",
pageIcons: {
horizontal: ["M0,0L12,-10L12,10z", "M0,0L-12,-10L-12,10z"],
vertical: ["M0,0L20,0L10,-20z", "M0,0L20,0L10,20z"]
},
pageIconColor: "#2f4554",
pageIconInactiveColor: "#aaa",
pageIconSize: 15,
pageTextStyle: {
color: "#333"
},
animationDurationUpdate: 800
}), e;
}(Pg)
);
function Bw(r, e, t) {
var n = r.getOrient(), a = [1, 1];
a[n.index] = 0, pa(e, t, {
type: "box",
ignoreSize: !!a
});
}
var zw = at, Op = ["width", "height"], Vp = ["x", "y"], P9 = (
/** @class */
function(r) {
O(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t.type = e.type, t.newlineDisabled = !0, t._currentIndex = 0, t;
}
return e.prototype.init = function() {
r.prototype.init.call(this), this.group.add(this._containerGroup = new zw()), this._containerGroup.add(this.getContentGroup()), this.group.add(this._controllerGroup = new zw());
}, e.prototype.resetInner = function() {
r.prototype.resetInner.call(this), this._controllerGroup.removeAll(), this._containerGroup.removeClipPath(), this._containerGroup.__rectSize = null;
}, e.prototype.renderInner = function(t, n, a, i, o, s, l) {
var u = this;
r.prototype.renderInner.call(this, t, n, a, i, o, s, l);
var h = this._controllerGroup, f = n.get("pageIconSize", !0), c = z(f) ? f : [f, f];
p("pagePrev", 0);
var v = n.getModel("pageTextStyle");
h.add(new wt({
name: "pageText",
style: {
// Placeholder to calculate a proper layout.
text: "xx/xx",
fill: v.getTextColor(),
font: v.getFont(),
verticalAlign: "middle",
align: "center"
},
silent: !0
})), p("pageNext", 1);
function p(d, g) {
var y = d + "DataIndex", m = Hl(n.get("pageIcons", !0)[n.getOrient().name][g], {
// Buttons will be created in each render, so we do not need
// to worry about avoiding using legendModel kept in scope.
onclick: Y(u._pageGo, u, y, n, i)
}, {
x: -c[0] / 2,
y: -c[1] / 2,
width: c[0],
height: c[1]
});
m.name = d, h.add(m);
}
}, e.prototype.layoutInner = function(t, n, a, i, o, s) {
var l = this.getSelectorGroup(), u = t.getOrient().index, h = Op[u], f = Vp[u], c = Op[1 - u], v = Vp[1 - u];
o && di(
// Buttons in selectorGroup always layout horizontally
"horizontal",
l,
t.get("selectorItemGap", !0)
);
var p = t.get("selectorButtonGap", !0), d = l.getBoundingRect(), g = [-d.x, -d.y], y = nt(a);
o && (y[h] = a[h] - d[h] - p);
var m = this._layoutContentAndController(t, i, y, u, h, c, v, f);
if (o) {
if (s === "end")
g[u] += m[h] + p;
else {
var _ = d[h] + p;
g[u] -= _, m[f] -= _;
}
m[h] += d[h] + p, g[1 - u] += m[v] + m[c] / 2 - d[c] / 2, m[c] = Math.max(m[c], d[c]), m[v] = Math.min(m[v], d[v] + g[1 - u]), l.x = g[0], l.y = g[1], l.markRedraw();
}
return m;
}, e.prototype._layoutContentAndController = function(t, n, a, i, o, s, l, u) {
var h = this.getContentGroup(), f = this._containerGroup, c = this._controllerGroup;
di(t.get("orient"), h, t.get("itemGap"), i ? a.width : null, i ? null : a.height), di(
// Buttons in controller are layout always horizontally.
"horizontal",
c,
t.get("pageButtonItemGap", !0)
);
var v = h.getBoundingRect(), p = c.getBoundingRect(), d = this._showController = v[o] > a[o], g = [-v.x, -v.y];
n || (g[i] = h[u]);
var y = [0, 0], m = [-p.x, -p.y], _ = ot(t.get("pageButtonGap", !0), t.get("itemGap", !0));
if (d) {
var S = t.get("pageButtonPosition", !0);
S === "end" ? m[i] += a[o] - p[o] : y[i] += p[o] + _;
}
m[1 - i] += v[s] / 2 - p[s] / 2, h.setPosition(g), f.setPosition(y), c.setPosition(m);
var x = {
x: 0,
y: 0
};
if (x[o] = d ? a[o] : v[o], x[s] = Math.max(v[s], p[s]), x[l] = Math.min(0, p[l] + m[1 - i]), f.__rectSize = a[o], d) {
var b = {
x: 0,
y: 0
};
b[o] = Math.max(a[o] - p[o] - _, 0), b[s] = x[s], f.setClipPath(new xt({
shape: b
})), f.__rectSize = b[o];
} else
c.eachChild(function(T) {
T.attr({
invisible: !0,
silent: !0
});
});
var w = this._getPageInfo(t);
return w.pageIndex != null && Ct(
h,
{
x: w.contentPosition[0],
y: w.contentPosition[1]
},
// When switch from "show controller" to "not show controller", view should be
// updated immediately without animation, otherwise causes weird effect.
d ? t : null
), this._updatePageInfoView(t, w), x;
}, e.prototype._pageGo = function(t, n, a) {
var i = this._getPageInfo(n)[t];
i != null && a.dispatchAction({
type: "legendScroll",
scrollDataIndex: i,
legendId: n.id
});
}, e.prototype._updatePageInfoView = function(t, n) {
var a = this._controllerGroup;
A(["pagePrev", "pageNext"], function(h) {
var f = h + "DataIndex", c = n[f] != null, v = a.childOfName(h);
v && (v.setStyle("fill", c ? t.get("pageIconColor", !0) : t.get("pageIconInactiveColor", !0)), v.cursor = c ? "pointer" : "default");
});
var i = a.childOfName("pageText"), o = t.get("pageFormatter"), s = n.pageIndex, l = s != null ? s + 1 : 0, u = n.pageCount;
i && o && i.setStyle("text", U(o) ? o.replace("{current}", l == null ? "" : l + "").replace("{total}", u == null ? "" : u + "") : o({
current: l,
total: u
}));
}, e.prototype._getPageInfo = function(t) {
var n = t.get("scrollDataIndex", !0), a = this.getContentGroup(), i = this._containerGroup.__rectSize, o = t.getOrient().index, s = Op[o], l = Vp[o], u = this._findTargetItemIndex(n), h = a.children(), f = h[u], c = h.length, v = c ? 1 : 0, p = {
contentPosition: [a.x, a.y],
pageCount: v,
pageIndex: v - 1,
pagePrevDataIndex: null,
pageNextDataIndex: null
};
if (!f)
return p;
var d = S(f);
p.contentPosition[o] = -d.s;
for (var g = u + 1, y = d, m = d, _ = null; g <= c; ++g)
_ = S(h[g]), // Half of the last item is out of the window.
(!_ && m.e > y.s + i || _ && !x(_, y.s)) && (m.i > y.i ? y = m : y = _, y && (p.pageNextDataIndex == null && (p.pageNextDataIndex = y.i), ++p.pageCount)), m = _;
for (var g = u - 1, y = d, m = d, _ = null; g >= -1; --g)
_ = S(h[g]), // If the the end item does not intersect with the window started
// from the current item, a page can be settled.
(!_ || !x(m, _.s)) && y.i < m.i && (m = y, p.pagePrevDataIndex == null && (p.pagePrevDataIndex = y.i), ++p.pageCount, ++p.pageIndex), y = _;
return p;
function S(b) {
if (b) {
var w = b.getBoundingRect(), T = w[l] + b[l];
return {
s: T,
e: T + w[s],
i: b.__legendDataIndex
};
}
}
function x(b, w) {
return b.e >= w && b.s <= w + i;
}
}, e.prototype._findTargetItemIndex = function(t) {
if (!this._showController)
return 0;
var n, a = this.getContentGroup(), i;
return a.eachChild(function(o, s) {
var l = o.__legendDataIndex;
i == null && l != null && (i = s), l === t && (n = s);
}), n ?? i;
}, e.type = "legend.scroll", e;
}(XI)
);
function k9(r) {
r.registerAction("legendScroll", "legendscroll", function(e, t) {
var n = e.scrollDataIndex;
n != null && t.eachComponent({
mainType: "legend",
subType: "scroll",
query: e
}, function(a) {
a.setScrollDataIndex(n);
});
});
}
function R9(r) {
gt(KI), r.registerComponentModel(E9), r.registerComponentView(P9), k9(r);
}
function N9(r) {
gt(KI), gt(R9);
}
var O9 = (
/** @class */
function(r) {
O(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t.type = e.type, t;
}
return e.type = "dataZoom.inside", e.defaultOption = _a(Il.defaultOption, {
disabled: !1,
zoomLock: !1,
zoomOnMouseWheel: !0,
moveOnMouseMove: !0,
moveOnMouseWheel: !1,
preventDefaultMouseMove: !0
}), e;
}(Il)
), Jm = bt();
function V9(r, e, t) {
Jm(r).coordSysRecordMap.each(function(n) {
var a = n.dataZoomInfoMap.get(e.uid);
a && (a.getRange = t);
});
}
function B9(r, e) {
for (var t = Jm(r).coordSysRecordMap, n = t.keys(), a = 0; a < n.length; a++) {
var i = n[a], o = t.get(i), s = o.dataZoomInfoMap;
if (s) {
var l = e.uid, u = s.get(l);
u && (s.removeKey(l), s.keys().length || jI(t, o));
}
}
}
function jI(r, e) {
if (e) {
r.removeKey(e.model.uid);
var t = e.controller;
t && t.dispose();
}
}
function z9(r, e) {
var t = {
model: e,
containsPoint: ut(F9, e),
dispatchAction: ut(G9, r),
dataZoomInfoMap: null,
controller: null
}, n = t.controller = new Ql(r.getZr());
return A(["pan", "zoom", "scrollMove"], function(a) {
n.on(a, function(i) {
var o = [];
t.dataZoomInfoMap.each(function(s) {
if (i.isAvailableBehavior(s.model.option)) {
var l = (s.getRange || {})[a], u = l && l(s.dzReferCoordSysInfo, t.model.mainType, t.controller, i);
!s.model.get("disabled", !0) && u && o.push({
dataZoomId: s.model.id,
start: u[0],
end: u[1]
});
}
}), o.length && t.dispatchAction(o);
});
}), t;
}
function G9(r, e) {
r.isDisposed() || r.dispatchAction({
type: "dataZoom",
animation: {
easing: "cubicOut",
duration: 100
},
batch: e
});
}
function F9(r, e, t, n) {
return r.coordinateSystem.containPoint([t, n]);
}
function H9(r) {
var e, t = "type_", n = {
type_true: 2,
type_move: 1,
type_false: 0,
type_undefined: -1
}, a = !0;
return r.each(function(i) {
var o = i.model, s = o.get("disabled", !0) ? !1 : o.get("zoomLock", !0) ? "move" : !0;
n[t + s] > n[t + e] && (e = s), a = a && o.get("preventDefaultMouseMove", !0);
}), {
controlType: e,
opt: {
// RoamController will enable all of these functionalities,
// and the final behavior is determined by its event listener
// provided by each inside zoom.
zoomOnMouseWheel: !0,
moveOnMouseMove: !0,
moveOnMouseWheel: !0,
preventDefaultMouseMove: !!a
}
};
}
function W9(r) {
r.registerProcessor(r.PRIORITY.PROCESSOR.FILTER, function(e, t) {
var n = Jm(t), a = n.coordSysRecordMap || (n.coordSysRecordMap = X());
a.each(function(i) {
i.dataZoomInfoMap = null;
}), e.eachComponent({
mainType: "dataZoom",
subType: "inside"
}, function(i) {
var o = kI(i);
A(o.infoList, function(s) {
var l = s.model.uid, u = a.get(l) || a.set(l, z9(t, s.model)), h = u.dataZoomInfoMap || (u.dataZoomInfoMap = X());
h.set(i.uid, {
dzReferCoordSysInfo: s,
model: i,
getRange: null
});
});
}), a.each(function(i) {
var o = i.controller, s, l = i.dataZoomInfoMap;
if (l) {
var u = l.keys()[0];
u != null && (s = l.get(u));
}
if (!s) {
jI(a, i);
return;
}
var h = H9(l);
o.enable(h.controlType, h.opt), o.setPointerChecker(i.containsPoint), Xo(i, "dispatchAction", s.model.get("throttle", !0), "fixRate");
});
});
}
var $9 = (
/** @class */
function(r) {
O(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t.type = "dataZoom.inside", t;
}
return e.prototype.render = function(t, n, a) {
if (r.prototype.render.apply(this, arguments), t.noTarget()) {
this._clear();
return;
}
this.range = t.getPercentRange(), V9(a, t, {
pan: Y(Bp.pan, this),
zoom: Y(Bp.zoom, this),
scrollMove: Y(Bp.scrollMove, this)
});
}, e.prototype.dispose = function() {
this._clear(), r.prototype.dispose.apply(this, arguments);
}, e.prototype._clear = function() {
B9(this.api, this.dataZoomModel), this.range = null;
}, e.type = "dataZoom.inside", e;
}($m)
), Bp = {
zoom: function(r, e, t, n) {
var a = this.range, i = a.slice(), o = r.axisModels[0];
if (o) {
var s = zp[e](null, [n.originX, n.originY], o, t, r), l = (s.signal > 0 ? s.pixelStart + s.pixelLength - s.pixel : s.pixel - s.pixelStart) / s.pixelLength * (i[1] - i[0]) + i[0], u = Math.max(1 / n.scale, 0);
i[0] = (i[0] - l) * u + l, i[1] = (i[1] - l) * u + l;
var h = this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();
if (Vi(0, i, [0, 100], 0, h.minSpan, h.maxSpan), this.range = i, a[0] !== i[0] || a[1] !== i[1])
return i;
}
},
pan: Gw(function(r, e, t, n, a, i) {
var o = zp[n]([i.oldX, i.oldY], [i.newX, i.newY], e, a, t);
return o.signal * (r[1] - r[0]) * o.pixel / o.pixelLength;
}),
scrollMove: Gw(function(r, e, t, n, a, i) {
var o = zp[n]([0, 0], [i.scrollDelta, i.scrollDelta], e, a, t);
return o.signal * (r[1] - r[0]) * i.scrollDelta;
})
};
function Gw(r) {
return function(e, t, n, a) {
var i = this.range, o = i.slice(), s = e.axisModels[0];
if (s) {
var l = r(o, s, e, t, n, a);
if (Vi(l, o, [0, 100], "all"), this.range = o, i[0] !== o[0] || i[1] !== o[1])
return o;
}
};
}
var zp = {
grid: function(r, e, t, n, a) {
var i = t.axis, o = {}, s = a.model.coordinateSystem.getRect();
return r = r || [0, 0], i.dim === "x" ? (o.pixel = e[0] - r[0], o.pixelLength = s.width, o.pixelStart = s.x, o.signal = i.inverse ? 1 : -1) : (o.pixel = e[1] - r[1], o.pixelLength = s.height, o.pixelStart = s.y, o.signal = i.inverse ? -1 : 1), o;
},
polar: function(r, e, t, n, a) {
var i = t.axis, o = {}, s = a.model.coordinateSystem, l = s.getRadiusAxis().getExtent(), u = s.getAngleAxis().getExtent();
return r = r ? s.pointToCoord(r) : [0, 0], e = s.pointToCoord(e), t.mainType === "radiusAxis" ? (o.pixel = e[0] - r[0], o.pixelLength = l[1] - l[0], o.pixelStart = l[0], o.signal = i.inverse ? 1 : -1) : (o.pixel = e[1] - r[1], o.pixelLength = u[1] - u[0], o.pixelStart = u[0], o.signal = i.inverse ? -1 : 1), o;
},
singleAxis: function(r, e, t, n, a) {
var i = t.axis, o = a.model.coordinateSystem.getRect(), s = {};
return r = r || [0, 0], i.orient === "horizontal" ? (s.pixel = e[0] - r[0], s.pixelLength = o.width, s.pixelStart = o.x, s.signal = i.inverse ? 1 : -1) : (s.pixel = e[1] - r[1], s.pixelLength = o.height, s.pixelStart = o.y, s.signal = i.inverse ? -1 : 1), s;
}
};
function QI(r) {
Um(r), r.registerComponentModel(O9), r.registerComponentView($9), W9(r);
}
var U9 = (
/** @class */
function(r) {
O(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t.type = e.type, t;
}
return e.type = "dataZoom.slider", e.layoutMode = "box", e.defaultOption = _a(Il.defaultOption, {
show: !0,
// deault value can only be drived in view stage.
right: "ph",
top: "ph",
width: "ph",
height: "ph",
left: null,
bottom: null,
borderColor: "#d2dbee",
borderRadius: 3,
backgroundColor: "rgba(47,69,84,0)",
// dataBackgroundColor: '#ddd',
dataBackground: {
lineStyle: {
color: "#d2dbee",
width: 0.5
},
areaStyle: {
color: "#d2dbee",
opacity: 0.2
}
},
selectedDataBackground: {
lineStyle: {
color: "#8fb0f7",
width: 0.5
},
areaStyle: {
color: "#8fb0f7",
opacity: 0.2
}
},
// Color of selected window.
fillerColor: "rgba(135,175,274,0.2)",
handleIcon: "path://M-9.35,34.56V42m0-40V9.5m-2,0h4a2,2,0,0,1,2,2v21a2,2,0,0,1-2,2h-4a2,2,0,0,1-2-2v-21A2,2,0,0,1-11.35,9.5Z",
// Percent of the slider height
handleSize: "100%",
handleStyle: {
color: "#fff",
borderColor: "#ACB8D1"
},
moveHandleSize: 7,
moveHandleIcon: "path://M-320.9-50L-320.9-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-348-41-339-50-320.9-50z M-212.3-50L-212.3-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-239.4-41-230.4-50-212.3-50z M-103.7-50L-103.7-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-130.9-41-121.8-50-103.7-50z",
moveHandleStyle: {
color: "#D2DBEE",
opacity: 0.7
},
showDetail: !0,
showDataShadow: "auto",
realtime: !0,
zoomLock: !1,
textStyle: {
color: "#6E7079"
},
brushSelect: !0,
brushStyle: {
color: "rgba(135,175,274,0.15)"
},
emphasis: {
handleLabel: {
show: !0
},
handleStyle: {
borderColor: "#8FB0F7"
},
moveHandleStyle: {
color: "#8FB0F7"
}
}
}), e;
}(Il)
), Ms = xt, Fw = 7, Y9 = 1, Gp = 30, Z9 = 7, Is = "horizontal", Hw = "vertical", X9 = 5, q9 = ["line", "bar", "candlestick", "scatter"], K9 = {
easing: "cubicOut",
duration: 100,
delay: 0
}, j9 = (
/** @class */
function(r) {
O(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t.type = e.type, t._displayables = {}, t;
}
return e.prototype.init = function(t, n) {
this.api = n, this._onBrush = Y(this._onBrush, this), this._onBrushEnd = Y(this._onBrushEnd, this);
}, e.prototype.render = function(t, n, a, i) {
if (r.prototype.render.apply(this, arguments), Xo(this, "_dispatchZoomAction", t.get("throttle"), "fixRate"), this._orient = t.getOrient(), t.get("show") === !1) {
this.group.removeAll();
return;
}
if (t.noTarget()) {
this._clear(), this.group.removeAll();
return;
}
(!i || i.type !== "dataZoom" || i.from !== this.uid) && this._buildView(), this._updateView();
}, e.prototype.dispose = function() {
this._clear(), r.prototype.dispose.apply(this, arguments);
}, e.prototype._clear = function() {
gl(this, "_dispatchZoomAction");
var t = this.api.getZr();
t.off("mousemove", this._onBrush), t.off("mouseup", this._onBrushEnd);
}, e.prototype._buildView = function() {
var t = this.group;
t.removeAll(), this._brushing = !1, this._displayables.brushRect = null, this._resetLocation(), this._resetInterval();
var n = this._displayables.sliderGroup = new at();
this._renderBackground(), this._renderHandle(), this._renderDataShadow(), t.add(n), this._positionGroup();
}, e.prototype._resetLocation = function() {
var t = this.dataZoomModel, n = this.api, a = t.get("brushSelect"), i = a ? Z9 : 0, o = this._findCoordRect(), s = {
width: n.getWidth(),
height: n.getHeight()
}, l = this._orient === Is ? {
// Why using 'right', because right should be used in vertical,
// and it is better to be consistent for dealing with position param merge.
right: s.width - o.x - o.width,
top: s.height - Gp - Fw - i,
width: o.width,
height: Gp
} : {
right: Fw,
top: o.y,
width: Gp,
height: o.height
}, u = $o(t.option);
A(["right", "top", "width", "height"], function(f) {
u[f] === "ph" && (u[f] = l[f]);
});
var h = se(u, s);
this._location = {
x: h.x,
y: h.y
}, this._size = [h.width, h.height], this._orient === Hw && this._size.reverse();
}, e.prototype._positionGroup = function() {
var t = this.group, n = this._location, a = this._orient, i = this.dataZoomModel.getFirstTargetAxisModel(), o = i && i.get("inverse"), s = this._displayables.sliderGroup, l = (this._dataShadowInfo || {}).otherAxisInverse;
s.attr(a === Is && !o ? {
scaleY: l ? 1 : -1,
scaleX: 1
} : a === Is && o ? {
scaleY: l ? 1 : -1,
scaleX: -1
} : a === Hw && !o ? {
scaleY: l ? -1 : 1,
scaleX: 1,
rotation: Math.PI / 2
} : {
scaleY: l ? -1 : 1,
scaleX: -1,
rotation: Math.PI / 2
});
var u = t.getBoundingRect([s]);
t.x = n.x - u.x, t.y = n.y - u.y, t.markRedraw();
}, e.prototype._getViewExtent = function() {
return [0, this._size[0]];
}, e.prototype._renderBackground = function() {
var t = this.dataZoomModel, n = this._size, a = this._displayables.sliderGroup, i = t.get("brushSelect");
a.add(new Ms({
silent: !0,
shape: {
x: 0,
y: 0,
width: n[0],
height: n[1]
},
style: {
fill: t.get("backgroundColor")
},
z2: -40
}));
var o = new Ms({
shape: {
x: 0,
y: 0,
width: n[0],
height: n[1]
},
style: {
fill: "transparent"
},
z2: 0,
onclick: Y(this._onClickPanel, this)
}), s = this.api.getZr();
i ? (o.on("mousedown", this._onBrushStart, this), o.cursor = "crosshair", s.on("mousemove", this._onBrush), s.on("mouseup", this._onBrushEnd)) : (s.off("mousemove", this._onBrush), s.off("mouseup", this._onBrushEnd)), a.add(o);
}, e.prototype._renderDataShadow = function() {
var t = this._dataShadowInfo = this._prepareDataShadowInfo();
if (this._displayables.dataShadowSegs = [], !t)
return;
var n = this._size, a = this._shadowSize || [], i = t.series, o = i.getRawData(), s = i.getShadowDim && i.getShadowDim(), l = s && o.getDimensionInfo(s) ? i.getShadowDim() : t.otherDim;
if (l == null)
return;
var u = this._shadowPolygonPts, h = this._shadowPolylinePts;
if (o !== this._shadowData || l !== this._shadowDim || n[0] !== a[0] || n[1] !== a[1]) {
var f = o.getDataExtent(l), c = (f[1] - f[0]) * 0.3;
f = [f[0] - c, f[1] + c];
var v = [0, n[1]], p = [0, n[0]], d = [[n[0], 0], [0, 0]], g = [], y = p[1] / (o.count() - 1), m = 0, _ = Math.round(o.count() / n[0]), S;
o.each([l], function(C, D) {
if (_ > 0 && D % _) {
m += y;
return;
}
var M = C == null || isNaN(C) || C === "", I = M ? 0 : Mt(C, f, v, !0);
M && !S && D ? (d.push([d[d.length - 1][0], 0]), g.push([g[g.length - 1][0], 0])) : !M && S && (d.push([m, 0]), g.push([m, 0])), d.push([m, I]), g.push([m, I]), m += y, S = M;
}), u = this._shadowPolygonPts = d, h = this._shadowPolylinePts = g;
}
this._shadowData = o, this._shadowDim = l, this._shadowSize = [n[0], n[1]];
var x = this.dataZoomModel;
function b(C) {
var D = x.getModel(C ? "selectedDataBackground" : "dataBackground"), M = new at(), I = new Fe({
shape: {
points: u
},
segmentIgnoreThreshold: 1,
style: D.getModel("areaStyle").getAreaStyle(),
silent: !0,
z2: -20
}), L = new He({
shape: {
points: h
},
segmentIgnoreThreshold: 1,
style: D.getModel("lineStyle").getLineStyle(),
silent: !0,
z2: -19
});
return M.add(I), M.add(L), M;
}
for (var w = 0; w < 3; w++) {
var T = b(w === 1);
this._displayables.sliderGroup.add(T), this._displayables.dataShadowSegs.push(T);
}
}, e.prototype._prepareDataShadowInfo = function() {
var t = this.dataZoomModel, n = t.get("showDataShadow");
if (n !== !1) {
var a, i = this.ecModel;
return t.eachTargetAxis(function(o, s) {
var l = t.getAxisProxy(o, s).getTargetSeriesModels();
A(l, function(u) {
if (!a && !(n !== !0 && pt(q9, u.get("type")) < 0)) {
var h = i.getComponent(ia(o), s).axis, f = Q9(o), c, v = u.coordinateSystem;
f != null && v.getOtherAxis && (c = v.getOtherAxis(h).inverse), f = u.getData().mapDimension(f), a = {
thisAxis: h,
series: u,
thisDim: o,
otherDim: f,
otherAxisInverse: c
};
}
}, this);
}, this), a;
}
}, e.prototype._renderHandle = function() {
var t = this.group, n = this._displayables, a = n.handles = [null, null], i = n.handleLabels = [null, null], o = this._displayables.sliderGroup, s = this._size, l = this.dataZoomModel, u = this.api, h = l.get("borderRadius") || 0, f = l.get("brushSelect"), c = n.filler = new Ms({
silent: f,
style: {
fill: l.get("fillerColor")
},
textConfig: {
position: "inside"
}
});
o.add(c), o.add(new Ms({
silent: !0,
subPixelOptimize: !0,
shape: {
x: 0,
y: 0,
width: s[0],
height: s[1],
r: h
},
style: {
// deprecated option
stroke: l.get("dataBackgroundColor") || l.get("borderColor"),
lineWidth: Y9,
fill: "rgba(0,0,0,0)"
}
})), A([0, 1], function(_) {
var S = l.get("handleIcon");
!Xh[S] && S.indexOf("path://") < 0 && S.indexOf("image://") < 0 && (S = "path://" + S, process.env.NODE_ENV !== "production" && Nr("handleIcon now needs 'path://' prefix when using a path string"));
var x = ae(S, -1, 0, 2, 2, null, !0);
x.attr({
cursor: Ww(this._orient),
draggable: !0,
drift: Y(this._onDragMove, this, _),
ondragend: Y(this._onDragEnd, this),
onmouseover: Y(this._showDataInfo, this, !0),
onmouseout: Y(this._showDataInfo, this, !1),
z2: 5
});
var b = x.getBoundingRect(), w = l.get("handleSize");
this._handleHeight = W(w, this._size[1]), this._handleWidth = b.width / b.height * this._handleHeight, x.setStyle(l.getModel("handleStyle").getItemStyle()), x.style.strokeNoScale = !0, x.rectHover = !0, x.ensureState("emphasis").style = l.getModel(["emphasis", "handleStyle"]).getItemStyle(), vi(x);
var T = l.get("handleColor");
T != null && (x.style.fill = T), o.add(a[_] = x);
var C = l.getModel("textStyle"), D = l.get("handleLabel") || {}, M = D.show || !1;
t.add(i[_] = new wt({
silent: !0,
invisible: !M,
style: Gt(C, {
x: 0,
y: 0,
text: "",
verticalAlign: "middle",
align: "center",
fill: C.getTextColor(),
font: C.getFont()
}),
z2: 10
}));
}, this);
var v = c;
if (f) {
var p = W(l.get("moveHandleSize"), s[1]), d = n.moveHandle = new xt({
style: l.getModel("moveHandleStyle").getItemStyle(),
silent: !0,
shape: {
r: [0, 0, 2, 2],
y: s[1] - 0.5,
height: p
}
}), g = p * 0.8, y = n.moveHandleIcon = ae(l.get("moveHandleIcon"), -g / 2, -g / 2, g, g, "#fff", !0);
y.silent = !0, y.y = s[1] + p / 2 - 0.5, d.ensureState("emphasis").style = l.getModel(["emphasis", "moveHandleStyle"]).getItemStyle();
var m = Math.min(s[1] / 2, Math.max(p, 10));
v = n.moveZone = new xt({
invisible: !0,
shape: {
y: s[1] - m,
height: p + m
}
}), v.on("mouseover", function() {
u.enterEmphasis(d);
}).on("mouseout", function() {
u.leaveEmphasis(d);
}), o.add(d), o.add(y), o.add(v);
}
v.attr({
draggable: !0,
cursor: Ww(this._orient),
drift: Y(this._onDragMove, this, "all"),
ondragstart: Y(this._showDataInfo, this, !0),
ondragend: Y(this._onDragEnd, this),
onmouseover: Y(this._showDataInfo, this, !0),
onmouseout: Y(this._showDataInfo, this, !1)
});
}, e.prototype._resetInterval = function() {
var t = this._range = this.dataZoomModel.getPercentRange(), n = this._getViewExtent();
this._handleEnds = [Mt(t[0], [0, 100], n, !0), Mt(t[1], [0, 100], n, !0)];
}, e.prototype._updateInterval = function(t, n) {
var a = this.dataZoomModel, i = this._handleEnds, o = this._getViewExtent(), s = a.findRepresentativeAxisProxy().getMinMaxSpan(), l = [0, 100];
Vi(n, i, o, a.get("zoomLock") ? "all" : t, s.minSpan != null ? Mt(s.minSpan, l, o, !0) : null, s.maxSpan != null ? Mt(s.maxSpan, l, o, !0) : null);
var u = this._range, h = this._range = yr([Mt(i[0], o, l, !0), Mt(i[1], o, l, !0)]);
return !u || u[0] !== h[0] || u[1] !== h[1];
}, e.prototype._updateView = function(t) {
var n = this._displayables, a = this._handleEnds, i = yr(a.slice()), o = this._size;
A([0, 1], function(v) {
var p = n.handles[v], d = this._handleHeight;
p.attr({
scaleX: d / 2,
scaleY: d / 2,
// This is a trick, by adding an extra tiny offset to let the default handle's end point align to the drag window.
// NOTE: It may affect some custom shapes a bit. But we prefer to have better result by default.
x: a[v] + (v ? -1 : 1),
y: o[1] / 2 - d / 2
});
}, this), n.filler.setShape({
x: i[0],
y: 0,
width: i[1] - i[0],
height: o[1]
});
var s = {
x: i[0],
width: i[1] - i[0]
};
n.moveHandle && (n.moveHandle.setShape(s), n.moveZone.setShape(s), n.moveZone.getBoundingRect(), n.moveHandleIcon && n.moveHandleIcon.attr("x", s.x + s.width / 2));
for (var l = n.dataShadowSegs, u = [0, i[0], i[1], o[0]], h = 0; h < l.length; h++) {
var f = l[h], c = f.getClipPath();
c || (c = new xt(), f.setClipPath(c)), c.setShape({
x: u[h],
y: 0,
width: u[h + 1] - u[h],
height: o[1]
});
}
this._updateDataInfo(t);
}, e.prototype._updateDataInfo = function(t) {
var n = this.dataZoomModel, a = this._displayables, i = a.handleLabels, o = this._orient, s = ["", ""];
if (n.get("showDetail")) {
var l = n.findRepresentativeAxisProxy();
if (l) {
var u = l.getAxisModel().axis, h = this._range, f = t ? l.calculateDataWindow({
start: h[0],
end: h[1]
}).valueWindow : l.getDataValueWindow();
s = [this._formatLabel(f[0], u), this._formatLabel(f[1], u)];
}
}
var c = yr(this._handleEnds.slice());
v.call(this, 0), v.call(this, 1);
function v(p) {
var d = pi(a.handles[p].parent, this.group), g = Xf(p === 0 ? "right" : "left", d), y = this._handleWidth / 2 + X9, m = kr([c[p] + (p === 0 ? -y : y), this._size[1] / 2], d);
i[p].setStyle({
x: m[0],
y: m[1],
verticalAlign: o === Is ? "middle" : g,
align: o === Is ? g : "center",
text: s[p]
});
}
}, e.prototype._formatLabel = function(t, n) {
var a = this.dataZoomModel, i = a.get("labelFormatter"), o = a.get("labelPrecision");
(o == null || o === "auto") && (o = n.getPixelPrecision());
var s = t == null || isNaN(t) ? "" : n.type === "category" || n.type === "time" ? n.scale.getLabel({
value: Math.round(t)
}) : t.toFixed(Math.min(o, 20));
return K(i) ? i(t, s) : U(i) ? i.replace("{value}", s) : s;
}, e.prototype._showDataInfo = function(t) {
var n = this.dataZoomModel.get("handleLabel") || {}, a = n.show || !1, i = this.dataZoomModel.getModel(["emphasis", "handleLabel"]), o = i.get("show") || !1, s = t || this._dragging ? o : a, l = this._displayables, u = l.handleLabels;
u[0].attr("invisible", !s), u[1].attr("invisible", !s), l.moveHandle && this.api[s ? "enterEmphasis" : "leaveEmphasis"](l.moveHandle, 1);
}, e.prototype._onDragMove = function(t, n, a, i) {
this._dragging = !0, Dn(i.event);
var o = this._displayables.sliderGroup.getLocalTransform(), s = kr([n, a], o, !0), l = this._updateInterval(t, s[0]), u = this.dataZoomModel.get("realtime");
this._updateView(!u), l && u && this._dispatchZoomAction(!0);
}, e.prototype._onDragEnd = function() {
this._dragging = !1, this._showDataInfo(!1);
var t = this.dataZoomModel.get("realtime");
!t && this._dispatchZoomAction(!1);
}, e.prototype._onClickPanel = function(t) {
var n = this._size, a = this._displayables.sliderGroup.transformCoordToLocal(t.offsetX, t.offsetY);
if (!(a[0] < 0 || a[0] > n[0] || a[1] < 0 || a[1] > n[1])) {
var i = this._handleEnds, o = (i[0] + i[1]) / 2, s = this._updateInterval("all", a[0] - o);
this._updateView(), s && this._dispatchZoomAction(!1);
}
}, e.prototype._onBrushStart = function(t) {
var n = t.offsetX, a = t.offsetY;
this._brushStart = new ft(n, a), this._brushing = !0, this._brushStartTime = +/* @__PURE__ */ new Date();
}, e.prototype._onBrushEnd = function(t) {
if (this._brushing) {
var n = this._displayables.brushRect;
if (this._brushing = !1, !!n) {
n.attr("ignore", !0);
var a = n.shape, i = +/* @__PURE__ */ new Date();
if (!(i - this._brushStartTime < 200 && Math.abs(a.width) < 5)) {
var o = this._getViewExtent(), s = [0, 100];
this._range = yr([Mt(a.x, o, s, !0), Mt(a.x + a.width, o, s, !0)]), this._handleEnds = [a.x, a.x + a.width], this._updateView(), this._dispatchZoomAction(!1);
}
}
}
}, e.prototype._onBrush = function(t) {
this._brushing && (Dn(t.event), this._updateBrushRect(t.offsetX, t.offsetY));
}, e.prototype._updateBrushRect = function(t, n) {
var a = this._displayables, i = this.dataZoomModel, o = a.brushRect;
o || (o = a.brushRect = new Ms({
silent: !0,
style: i.getModel("brushStyle").getItemStyle()
}), a.sliderGroup.add(o)), o.attr("ignore", !1);
var s = this._brushStart, l = this._displayables.sliderGroup, u = l.transformCoordToLocal(t, n), h = l.transformCoordToLocal(s.x, s.y), f = this._size;
u[0] = Math.max(Math.min(f[0], u[0]), 0), o.setShape({
x: h[0],
y: 0,
width: u[0] - h[0],
height: f[1]
});
}, e.prototype._dispatchZoomAction = function(t) {
var n = this._range;
this.api.dispatchAction({
type: "dataZoom",
from: this.uid,
dataZoomId: this.dataZoomModel.id,
animation: t ? K9 : null,
start: n[0],
end: n[1]
});
}, e.prototype._findCoordRect = function() {
var t, n = kI(this.dataZoomModel).infoList;
if (!t && n.length) {
var a = n[0].model.coordinateSystem;
t = a.getRect && a.getRect();
}
if (!t) {
var i = this.api.getWidth(), o = this.api.getHeight();
t = {
x: i * 0.2,
y: o * 0.2,
width: i * 0.6,
height: o * 0.6
};
}
return t;
}, e.type = "dataZoom.slider", e;
}($m)
);
function Q9(r) {
var e = {
x: "y",
y: "x",
radius: "angle",
angle: "radius"
};
return e[r];
}
function Ww(r) {
return r === "vertical" ? "ns-resize" : "ew-resize";
}
function JI(r) {
r.registerComponentModel(U9), r.registerComponentView(j9), Um(r);
}
function J9(r) {
gt(QI), gt(JI);
}
var tL = {
/**
* @public
*/
get: function(r, e, t) {
var n = nt((tU[r] || {})[e]);
return t && z(n) ? n[n.length - 1] : n;
}
}, tU = {
color: {
active: ["#006edd", "#e0ffff"],
inactive: ["rgba(0,0,0,0)"]
},
colorHue: {
active: [0, 360],
inactive: [0, 0]
},
colorSaturation: {
active: [0.3, 1],
inactive: [0, 0]
},
colorLightness: {
active: [0.9, 0.5],
inactive: [0, 0]
},
colorAlpha: {
active: [0.3, 1],
inactive: [0, 0]
},
opacity: {
active: [0.3, 1],
inactive: [0, 0]
},
symbol: {
active: ["circle", "roundRect", "diamond"],
inactive: ["none"]
},
symbolSize: {
active: [10, 50],
inactive: [0, 0]
}
}, $w = ce.mapVisual, eU = ce.eachVisual, rU = z, Uw = A, nU = yr, aU = Mt, bf = (
/** @class */
function(r) {
O(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t.type = e.type, t.stateList = ["inRange", "outOfRange"], t.replacableOptionKeys = ["inRange", "outOfRange", "target", "controller", "color"], t.layoutMode = {
type: "box",
ignoreSize: !0
}, t.dataBound = [-1 / 0, 1 / 0], t.targetVisuals = {}, t.controllerVisuals = {}, t;
}
return e.prototype.init = function(t, n, a) {
this.mergeDefaultAndTheme(t, a);
}, e.prototype.optionUpdated = function(t, n) {
var a = this.option;
!n && WI(a, t, this.replacableOptionKeys), this.textStyleModel = this.getModel("textStyle"), this.resetItemSize(), this.completeVisualOption();
}, e.prototype.resetVisual = function(t) {
var n = this.stateList;
t = Y(t, this), this.controllerVisuals = Ig(this.option.controller, n, t), this.targetVisuals = Ig(this.option.target, n, t);
}, e.prototype.getItemSymbol = function() {
return null;
}, e.prototype.getTargetSeriesIndices = function() {
var t = this.option.seriesIndex, n = [];
return t == null || t === "all" ? this.ecModel.eachSeries(function(a, i) {
n.push(i);
}) : n = Pt(t), n;
}, e.prototype.eachTargetSeries = function(t, n) {
A(this.getTargetSeriesIndices(), function(a) {
var i = this.ecModel.getSeriesByIndex(a);
i && t.call(n, i);
}, this);
}, e.prototype.isTargetSeries = function(t) {
var n = !1;
return this.eachTargetSeries(function(a) {
a === t && (n = !0);
}), n;
}, e.prototype.formatValueText = function(t, n, a) {
var i = this.option, o = i.precision, s = this.dataBound, l = i.formatter, u;
a = a || ["<", ">"], z(t) && (t = t.slice(), u = !0);
var h = n ? t : u ? [f(t[0]), f(t[1])] : f(t);
if (U(l))
return l.replace("{value}", u ? h[0] : h).replace("{value2}", u ? h[1] : h);
if (K(l))
return u ? l(t[0], t[1]) : l(t);
if (u)
return t[0] === s[0] ? a[0] + " " + h[1] : t[1] === s[1] ? a[1] + " " + h[0] : h[0] + " - " + h[1];
return h;
function f(c) {
return c === s[0] ? "min" : c === s[1] ? "max" : (+c).toFixed(Math.min(o, 20));
}
}, e.prototype.resetExtent = function() {
var t = this.option, n = nU([t.min, t.max]);
this._dataExtent = n;
}, e.prototype.getDataDimensionIndex = function(t) {
var n = this.option.dimension;
if (n != null)
return t.getDimensionIndex(n);
for (var a = t.dimensions, i = a.length - 1; i >= 0; i--) {
var o = a[i], s = t.getDimensionInfo(o);
if (!s.isCalculationCoord)
return s.storeDimIndex;
}
}, e.prototype.getExtent = function() {
return this._dataExtent.slice();
}, e.prototype.completeVisualOption = function() {
var t = this.ecModel, n = this.option, a = {
inRange: n.inRange,
outOfRange: n.outOfRange
}, i = n.target || (n.target = {}), o = n.controller || (n.controller = {});
ht(i, a), ht(o, a);
var s = this.isCategory();
l.call(this, i), l.call(this, o), u.call(this, i, "inRange", "outOfRange"), h.call(this, o);
function l(f) {
rU(n.color) && !f.inRange && (f.inRange = {
color: n.color.slice().reverse()
}), f.inRange = f.inRange || {
color: t.get("gradientColor")
};
}
function u(f, c, v) {
var p = f[c], d = f[v];
p && !d && (d = f[v] = {}, Uw(p, function(g, y) {
if (ce.isValidType(y)) {
var m = tL.get(y, "inactive", s);
m != null && (d[y] = m, y === "color" && !d.hasOwnProperty("opacity") && !d.hasOwnProperty("colorAlpha") && (d.opacity = [0, 0]));
}
}));
}
function h(f) {
var c = (f.inRange || {}).symbol || (f.outOfRange || {}).symbol, v = (f.inRange || {}).symbolSize || (f.outOfRange || {}).symbolSize, p = this.get("inactiveColor"), d = this.getItemSymbol(), g = d || "roundRect";
Uw(this.stateList, function(y) {
var m = this.itemSize, _ = f[y];
_ || (_ = f[y] = {
color: s ? p : [p]
}), _.symbol == null && (_.symbol = c && nt(c) || (s ? g : [g])), _.symbolSize == null && (_.symbolSize = v && nt(v) || (s ? m[0] : [m[0], m[0]])), _.symbol = $w(_.symbol, function(b) {
return b === "none" ? g : b;
});
var S = _.symbolSize;
if (S != null) {
var x = -1 / 0;
eU(S, function(b) {
b > x && (x = b);
}), _.symbolSize = $w(S, function(b) {
return aU(b, [0, x], [0, m[0]], !0);
});
}
}, this);
}
}, e.prototype.resetItemSize = function() {
this.itemSize = [parseFloat(this.get("itemWidth")), parseFloat(this.get("itemHeight"))];
}, e.prototype.isCategory = function() {
return !!this.option.categories;
}, e.prototype.setSelected = function(t) {
}, e.prototype.getSelected = function() {
return null;
}, e.prototype.getValueState = function(t) {
return null;
}, e.prototype.getVisualMeta = function(t) {
return null;
}, e.type = "visualMap", e.dependencies = ["series"], e.defaultOption = {
show: !0,
// zlevel: 0,
z: 4,
seriesIndex: "all",
min: 0,
max: 200,
left: 0,
right: null,
top: null,
bottom: 0,
itemWidth: null,
itemHeight: null,
inverse: !1,
orient: "vertical",
backgroundColor: "rgba(0,0,0,0)",
borderColor: "#ccc",
contentColor: "#5793f3",
inactiveColor: "#aaa",
borderWidth: 0,
padding: 5,
// 接受数组分别设定上右下左边距,同css
textGap: 10,
precision: 0,
textStyle: {
color: "#333"
// 值域文字颜色
}
}, e;
}(_t)
), Yw = [20, 140], iU = (
/** @class */
function(r) {
O(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t.type = e.type, t;
}
return e.prototype.optionUpdated = function(t, n) {
r.prototype.optionUpdated.apply(this, arguments), this.resetExtent(), this.resetVisual(function(a) {
a.mappingMethod = "linear", a.dataExtent = this.getExtent();
}), this._resetRange();
}, e.prototype.resetItemSize = function() {
r.prototype.resetItemSize.apply(this, arguments);
var t = this.itemSize;
(t[0] == null || isNaN(t[0])) && (t[0] = Yw[0]), (t[1] == null || isNaN(t[1])) && (t[1] = Yw[1]);
}, e.prototype._resetRange = function() {
var t = this.getExtent(), n = this.option.range;
!n || n.auto ? (t.auto = 1, this.option.range = t) : z(n) && (n[0] > n[1] && n.reverse(), n[0] = Math.max(n[0], t[0]), n[1] = Math.min(n[1], t[1]));
}, e.prototype.completeVisualOption = function() {
r.prototype.completeVisualOption.apply(this, arguments), A(this.stateList, function(t) {
var n = this.option.controller[t].symbolSize;
n && n[0] !== n[1] && (n[0] = n[1] / 3);
}, this);
}, e.prototype.setSelected = function(t) {
this.option.range = t.slice(), this._resetRange();
}, e.prototype.getSelected = function() {
var t = this.getExtent(), n = yr((this.get("range") || []).slice());
return n[0] > t[1] && (n[0] = t[1]), n[1] > t[1] && (n[1] = t[1]), n[0] < t[0] && (n[0] = t[0]), n[1] < t[0] && (n[1] = t[0]), n;
}, e.prototype.getValueState = function(t) {
var n = this.option.range, a = this.getExtent();
return (n[0] <= a[0] || n[0] <= t) && (n[1] >= a[1] || t <= n[1]) ? "inRange" : "outOfRange";
}, e.prototype.findTargetDataIndices = function(t) {
var n = [];
return this.eachTargetSeries(function(a) {
var i = [], o = a.getData();
o.each(this.getDataDimensionIndex(o), function(s, l) {
t[0] <= s && s <= t[1] && i.push(l);
}, this), n.push({
seriesId: a.id,
dataIndex: i
});
}, this), n;
}, e.prototype.getVisualMeta = function(t) {
var n = Zw(this, "outOfRange", this.getExtent()), a = Zw(this, "inRange", this.option.range.slice()), i = [];
function o(v, p) {
i.push({
value: v,
color: t(v, p)
});
}
for (var s = 0, l = 0, u = a.length, h = n.length; l < h && (!a.length || n[l] <= a[0]); l++)
n[l] < a[s] && o(n[l], "outOfRange");
for (var f = 1; s < u; s++, f = 0)
f && i.length && o(a[s], "outOfRange"), o(a[s], "inRange");
for (var f = 1; l < h; l++)
(!a.length || a[a.length - 1] < n[l]) && (f && (i.length && o(i[i.length - 1].value, "outOfRange"), f = 0), o(n[l], "outOfRange"));
var c = i.length;
return {
stops: i,
outerColors: [c ? i[0].color : "transparent", c ? i[c - 1].color : "transparent"]
};
}, e.type = "visualMap.continuous", e.defaultOption = _a(bf.defaultOption, {
align: "auto",
calculable: !1,
hoverLink: !0,
realtime: !0,
handleIcon: "path://M-11.39,9.77h0a3.5,3.5,0,0,1-3.5,3.5h-22a3.5,3.5,0,0,1-3.5-3.5h0a3.5,3.5,0,0,1,3.5-3.5h22A3.5,3.5,0,0,1-11.39,9.77Z",
handleSize: "120%",
handleStyle: {
borderColor: "#fff",
borderWidth: 1
},
indicatorIcon: "circle",
indicatorSize: "50%",
indicatorStyle: {
borderColor: "#fff",
borderWidth: 2,
shadowBlur: 2,
shadowOffsetX: 1,
shadowOffsetY: 1,
shadowColor: "rgba(0,0,0,0.2)"
}
// emphasis: {
// handleStyle: {
// shadowBlur: 3,
// shadowOffsetX: 1,
// shadowOffsetY: 1,
// shadowColor: 'rgba(0,0,0,0.2)'
// }
// }
}), e;
}(bf)
);
function Zw(r, e, t) {
if (t[0] === t[1])
return t.slice();
for (var n = 200, a = (t[1] - t[0]) / n, i = t[0], o = [], s = 0; s <= n && i < t[1]; s++)
o.push(i), i += a;
return o.push(t[1]), o;
}
var eL = (
/** @class */
function(r) {
O(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t.type = e.type, t.autoPositionValues = {
left: 1,
right: 1,
top: 1,
bottom: 1
}, t;
}
return e.prototype.init = function(t, n) {
this.ecModel = t, this.api = n;
}, e.prototype.render = function(t, n, a, i) {
if (this.visualMapModel = t, t.get("show") === !1) {
this.group.removeAll();
return;
}
this.doRender(t, n, a, i);
}, e.prototype.renderBackground = function(t) {
var n = this.visualMapModel, a = Wo(n.get("padding") || 0), i = t.getBoundingRect();
t.add(new xt({
z2: -1,
silent: !0,
shape: {
x: i.x - a[3],
y: i.y - a[0],
width: i.width + a[3] + a[1],
height: i.height + a[0] + a[2]
},
style: {
fill: n.get("backgroundColor"),
stroke: n.get("borderColor"),
lineWidth: n.get("borderWidth")
}
}));
}, e.prototype.getControllerVisual = function(t, n, a) {
a = a || {};
var i = a.forceState, o = this.visualMapModel, s = {};
if (n === "color") {
var l = o.get("contentColor");
s.color = l;
}
function u(v) {
return s[v];
}
function h(v, p) {
s[v] = p;
}
var f = o.controllerVisuals[i || o.getValueState(t)], c = ce.prepareVisualTypes(f);
return A(c, function(v) {
var p = f[v];
a.convertOpacityToAlpha && v === "opacity" && (v = "colorAlpha", p = f.__alphaForOpacity), ce.dependsOn(v, n) && p && p.applyVisual(t, u, h);
}), s[n];
}, e.prototype.positionGroup = function(t) {
var n = this.visualMapModel, a = this.api;
ec(t, n.getBoxLayoutParams(), {
width: a.getWidth(),
height: a.getHeight()
});
}, e.prototype.doRender = function(t, n, a, i) {
}, e.type = "visualMap", e;
}(Yt)
), Xw = [["left", "right", "width"], ["top", "bottom", "height"]];
function rL(r, e, t) {
var n = r.option, a = n.align;
if (a != null && a !== "auto")
return a;
for (var i = {
width: e.getWidth(),
height: e.getHeight()
}, o = n.orient === "horizontal" ? 1 : 0, s = Xw[o], l = [0, null, 10], u = {}, h = 0; h < 3; h++)
u[Xw[1 - o][h]] = l[h], u[s[h]] = h === 2 ? t[0] : n[s[h]];
var f = [["x", "width", 3], ["y", "height", 0]][o], c = se(u, i, n.padding);
return s[(c.margin[f[2]] || 0) + c[f[0]] + c[f[1]] * 0.5 < i[f[1]] * 0.5 ? 0 : 1];
}
function Th(r, e) {
return A(r || [], function(t) {
t.dataIndex != null && (t.dataIndexInside = t.dataIndex, t.dataIndex = null), t.highlightKey = "visualMap" + (e ? e.componentIndex : "");
}), r;
}
var Yr = Mt, oU = A, qw = Math.min, Fp = Math.max, sU = 12, lU = 6, uU = (
/** @class */
function(r) {
O(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t.type = e.type, t._shapes = {}, t._dataInterval = [], t._handleEnds = [], t._hoverLinkDataIndices = [], t;
}
return e.prototype.init = function(t, n) {
r.prototype.init.call(this, t, n), this._hoverLinkFromSeriesMouseOver = Y(this._hoverLinkFromSeriesMouseOver, this), this._hideIndicator = Y(this._hideIndicator, this);
}, e.prototype.doRender = function(t, n, a, i) {
(!i || i.type !== "selectDataRange" || i.from !== this.uid) && this._buildView();
}, e.prototype._buildView = function() {
this.group.removeAll();
var t = this.visualMapModel, n = this.group;
this._orient = t.get("orient"), this._useHandle = t.get("calculable"), this._resetInterval(), this._renderBar(n);
var a = t.get("text");
this._renderEndsText(n, a, 0), this._renderEndsText(n, a, 1), this._updateView(!0), this.renderBackground(n), this._updateView(), this._enableHoverLinkToSeries(), this._enableHoverLinkFromSeries(), this.positionGroup(n);
}, e.prototype._renderEndsText = function(t, n, a) {
if (n) {
var i = n[1 - a];
i = i != null ? i + "" : "";
var o = this.visualMapModel, s = o.get("textGap"), l = o.itemSize, u = this._shapes.mainGroup, h = this._applyTransform([l[0] / 2, a === 0 ? -s : l[1] + s], u), f = this._applyTransform(a === 0 ? "bottom" : "top", u), c = this._orient, v = this.visualMapModel.textStyleModel;
this.group.add(new wt({
style: Gt(v, {
x: h[0],
y: h[1],
verticalAlign: c === "horizontal" ? "middle" : f,
align: c === "horizontal" ? f : "center",
text: i
})
}));
}
}, e.prototype._renderBar = function(t) {
var n = this.visualMapModel, a = this._shapes, i = n.itemSize, o = this._orient, s = this._useHandle, l = rL(n, this.api, i), u = a.mainGroup = this._createBarGroup(l), h = new at();
u.add(h), h.add(a.outOfRange = Kw()), h.add(a.inRange = Kw(null, s ? Qw(this._orient) : null, Y(this._dragHandle, this, "all", !1), Y(this._dragHandle, this, "all", !0))), h.setClipPath(new xt({
shape: {
x: 0,
y: 0,
width: i[0],
height: i[1],
r: 3
}
}));
var f = n.textStyleModel.getTextRect("国"), c = Fp(f.width, f.height);
s && (a.handleThumbs = [], a.handleLabels = [], a.handleLabelPoints = [], this._createHandle(n, u, 0, i, c, o), this._createHandle(n, u, 1, i, c, o)), this._createIndicator(n, u, i, c, o), t.add(u);
}, e.prototype._createHandle = function(t, n, a, i, o, s) {
var l = Y(this._dragHandle, this, a, !1), u = Y(this._dragHandle, this, a, !0), h = Rr(t.get("handleSize"), i[0]), f = ae(t.get("handleIcon"), -h / 2, -h / 2, h, h, null, !0), c = Qw(this._orient);
f.attr({
cursor: c,
draggable: !0,
drift: l,
ondragend: u,
onmousemove: function(y) {
Dn(y.event);
}
}), f.x = i[0] / 2, f.useStyle(t.getModel("handleStyle").getItemStyle()), f.setStyle({
strokeNoScale: !0,
strokeFirst: !0
}), f.style.lineWidth *= 2, f.ensureState("emphasis").style = t.getModel(["emphasis", "handleStyle"]).getItemStyle(), ni(f, !0), n.add(f);
var v = this.visualMapModel.textStyleModel, p = new wt({
cursor: c,
draggable: !0,
drift: l,
onmousemove: function(y) {
Dn(y.event);
},
ondragend: u,
style: Gt(v, {
x: 0,
y: 0,
text: ""
})
});
p.ensureState("blur").style = {
opacity: 0.1
}, p.stateTransition = {
duration: 200
}, this.group.add(p);
var d = [h, 0], g = this._shapes;
g.handleThumbs[a] = f, g.handleLabelPoints[a] = d, g.handleLabels[a] = p;
}, e.prototype._createIndicator = function(t, n, a, i, o) {
var s = Rr(t.get("indicatorSize"), a[0]), l = ae(t.get("indicatorIcon"), -s / 2, -s / 2, s, s, null, !0);
l.attr({
cursor: "move",
invisible: !0,
silent: !0,
x: a[0] / 2
});
var u = t.getModel("indicatorStyle").getItemStyle();
if (l instanceof ge) {
var h = l.style;
l.useStyle(B({
// TODO other properties like x, y ?
image: h.image,
x: h.x,
y: h.y,
width: h.width,
height: h.height
}, u));
} else
l.useStyle(u);
n.add(l);
var f = this.visualMapModel.textStyleModel, c = new wt({
silent: !0,
invisible: !0,
style: Gt(f, {
x: 0,
y: 0,
text: ""
})
});
this.group.add(c);
var v = [(o === "horizontal" ? i / 2 : lU) + a[0] / 2, 0], p = this._shapes;
p.indicator = l, p.indicatorLabel = c, p.indicatorLabelPoint = v, this._firstShowIndicator = !0;
}, e.prototype._dragHandle = function(t, n, a, i) {
if (this._useHandle) {
if (this._dragging = !n, !n) {
var o = this._applyTransform([a, i], this._shapes.mainGroup, !0);
this._updateInterval(t, o[1]), this._hideIndicator(), this._updateView();
}
n === !this.visualMapModel.get("realtime") && this.api.dispatchAction({
type: "selectDataRange",
from: this.uid,
visualMapId: this.visualMapModel.id,
selected: this._dataInterval.slice()
}), n ? !this._hovering && this._clearHoverLinkToSeries() : jw(this.visualMapModel) && this._doHoverLinkToSeries(this._handleEnds[t], !1);
}
}, e.prototype._resetInterval = function() {
var t = this.visualMapModel, n = this._dataInterval = t.getSelected(), a = t.getExtent(), i = [0, t.itemSize[1]];
this._handleEnds = [Yr(n[0], a, i, !0), Yr(n[1], a, i, !0)];
}, e.prototype._updateInterval = function(t, n) {
n = n || 0;
var a = this.visualMapModel, i = this._handleEnds, o = [0, a.itemSize[1]];
Vi(
n,
i,
o,
t,
// cross is forbidden
0
);
var s = a.getExtent();
this._dataInterval = [Yr(i[0], o, s, !0), Yr(i[1], o, s, !0)];
}, e.prototype._updateView = function(t) {
var n = this.visualMapModel, a = n.getExtent(), i = this._shapes, o = [0, n.itemSize[1]], s = t ? o : this._handleEnds, l = this._createBarVisual(this._dataInterval, a, s, "inRange"), u = this._createBarVisual(a, a, o, "outOfRange");
i.inRange.setStyle({
fill: l.barColor
// opacity: visualInRange.opacity
}).setShape("points", l.barPoints), i.outOfRange.setStyle({
fill: u.barColor
// opacity: visualOutOfRange.opacity
}).setShape("points", u.barPoints), this._updateHandle(s, l);
}, e.prototype._createBarVisual = function(t, n, a, i) {
var o = {
forceState: i,
convertOpacityToAlpha: !0
}, s = this._makeColorGradient(t, o), l = [this.getControllerVisual(t[0], "symbolSize", o), this.getControllerVisual(t[1], "symbolSize", o)], u = this._createBarPoints(a, l);
return {
barColor: new Gl(0, 0, 0, 1, s),
barPoints: u,
handlesColor: [s[0].color, s[s.length - 1].color]
};
}, e.prototype._makeColorGradient = function(t, n) {
var a = 100, i = [], o = (t[1] - t[0]) / a;
i.push({
color: this.getControllerVisual(t[0], "color", n),
offset: 0
});
for (var s = 1; s < a; s++) {
var l = t[0] + o * s;
if (l > t[1])
break;
i.push({
color: this.getControllerVisual(l, "color", n),
offset: s / a
});
}
return i.push({
color: this.getControllerVisual(t[1], "color", n),
offset: 1
}), i;
}, e.prototype._createBarPoints = function(t, n) {
var a = this.visualMapModel.itemSize;
return [[a[0] - n[0], t[0]], [a[0], t[0]], [a[0], t[1]], [a[0] - n[1], t[1]]];
}, e.prototype._createBarGroup = function(t) {
var n = this._orient, a = this.visualMapModel.get("inverse");
return new at(n === "horizontal" && !a ? {
scaleX: t === "bottom" ? 1 : -1,
rotation: Math.PI / 2
} : n === "horizontal" && a ? {
scaleX: t === "bottom" ? -1 : 1,
rotation: -Math.PI / 2
} : n === "vertical" && !a ? {
scaleX: t === "left" ? 1 : -1,
scaleY: -1
} : {
scaleX: t === "left" ? 1 : -1
});
}, e.prototype._updateHandle = function(t, n) {
if (this._useHandle) {
var a = this._shapes, i = this.visualMapModel, o = a.handleThumbs, s = a.handleLabels, l = i.itemSize, u = i.getExtent(), h = this._applyTransform("left", a.mainGroup);
oU([0, 1], function(f) {
var c = o[f];
c.setStyle("fill", n.handlesColor[f]), c.y = t[f];
var v = Yr(t[f], [0, l[1]], u, !0), p = this.getControllerVisual(v, "symbolSize");
c.scaleX = c.scaleY = p / l[0], c.x = l[0] - p / 2;
var d = kr(a.handleLabelPoints[f], pi(c, this.group));
if (this._orient === "horizontal") {
var g = h === "left" || h === "top" ? (l[0] - p) / 2 : (l[0] - p) / -2;
d[1] += g;
}
s[f].setStyle({
x: d[0],
y: d[1],
text: i.formatValueText(this._dataInterval[f]),
verticalAlign: "middle",
align: this._orient === "vertical" ? this._applyTransform("left", a.mainGroup) : "center"
});
}, this);
}
}, e.prototype._showIndicator = function(t, n, a, i) {
var o = this.visualMapModel, s = o.getExtent(), l = o.itemSize, u = [0, l[1]], h = this._shapes, f = h.indicator;
if (f) {
f.attr("invisible", !1);
var c = {
convertOpacityToAlpha: !0
}, v = this.getControllerVisual(t, "color", c), p = this.getControllerVisual(t, "symbolSize"), d = Yr(t, s, u, !0), g = l[0] - p / 2, y = {
x: f.x,
y: f.y
};
f.y = d, f.x = g;
var m = kr(h.indicatorLabelPoint, pi(f, this.group)), _ = h.indicatorLabel;
_.attr("invisible", !1);
var S = this._applyTransform("left", h.mainGroup), x = this._orient, b = x === "horizontal";
_.setStyle({
text: (a || "") + o.formatValueText(n),
verticalAlign: b ? S : "middle",
align: b ? "center" : S
});
var w = {
x: g,
y: d,
style: {
fill: v
}
}, T = {
style: {
x: m[0],
y: m[1]
}
};
if (o.ecModel.isAnimationEnabled() && !this._firstShowIndicator) {
var C = {
duration: 100,
easing: "cubicInOut",
additive: !0
};
f.x = y.x, f.y = y.y, f.animateTo(w, C), _.animateTo(T, C);
} else
f.attr(w), _.attr(T);
this._firstShowIndicator = !1;
var D = this._shapes.handleLabels;
if (D)
for (var M = 0; M < D.length; M++)
this.api.enterBlur(D[M]);
}
}, e.prototype._enableHoverLinkToSeries = function() {
var t = this;
this._shapes.mainGroup.on("mousemove", function(n) {
if (t._hovering = !0, !t._dragging) {
var a = t.visualMapModel.itemSize, i = t._applyTransform([n.offsetX, n.offsetY], t._shapes.mainGroup, !0, !0);
i[1] = qw(Fp(0, i[1]), a[1]), t._doHoverLinkToSeries(i[1], 0 <= i[0] && i[0] <= a[0]);
}
}).on("mouseout", function() {
t._hovering = !1, !t._dragging && t._clearHoverLinkToSeries();
});
}, e.prototype._enableHoverLinkFromSeries = function() {
var t = this.api.getZr();
this.visualMapModel.option.hoverLink ? (t.on("mouseover", this._hoverLinkFromSeriesMouseOver, this), t.on("mouseout", this._hideIndicator, this)) : this._clearHoverLinkFromSeries();
}, e.prototype._doHoverLinkToSeries = function(t, n) {
var a = this.visualMapModel, i = a.itemSize;
if (a.option.hoverLink) {
var o = [0, i[1]], s = a.getExtent();
t = qw(Fp(o[0], t), o[1]);
var l = hU(a, s, o), u = [t - l, t + l], h = Yr(t, o, s, !0), f = [Yr(u[0], o, s, !0), Yr(u[1], o, s, !0)];
u[0] < o[0] && (f[0] = -1 / 0), u[1] > o[1] && (f[1] = 1 / 0), n && (f[0] === -1 / 0 ? this._showIndicator(h, f[1], "< ", l) : f[1] === 1 / 0 ? this._showIndicator(h, f[0], "> ", l) : this._showIndicator(h, h, "≈ ", l));
var c = this._hoverLinkDataIndices, v = [];
(n || jw(a)) && (v = this._hoverLinkDataIndices = a.findTargetDataIndices(f));
var p = pk(c, v);
this._dispatchHighDown("downplay", Th(p[0], a)), this._dispatchHighDown("highlight", Th(p[1], a));
}
}, e.prototype._hoverLinkFromSeriesMouseOver = function(t) {
var n;
if (ii(t.target, function(l) {
var u = it(l);
if (u.dataIndex != null)
return n = u, !0;
}, !0), !!n) {
var a = this.ecModel.getSeriesByIndex(n.seriesIndex), i = this.visualMapModel;
if (i.isTargetSeries(a)) {
var o = a.getData(n.dataType), s = o.getStore().get(i.getDataDimensionIndex(o), n.dataIndex);
isNaN(s) || this._showIndicator(s, s);
}
}
}, e.prototype._hideIndicator = function() {
var t = this._shapes;
t.indicator && t.indicator.attr("invisible", !0), t.indicatorLabel && t.indicatorLabel.attr("invisible", !0);
var n = this._shapes.handleLabels;
if (n)
for (var a = 0; a < n.length; a++)
this.api.leaveBlur(n[a]);
}, e.prototype._clearHoverLinkToSeries = function() {
this._hideIndicator();
var t = this._hoverLinkDataIndices;
this._dispatchHighDown("downplay", Th(t, this.visualMapModel)), t.length = 0;
}, e.prototype._clearHoverLinkFromSeries = function() {
this._hideIndicator();
var t = this.api.getZr();
t.off("mouseover", this._hoverLinkFromSeriesMouseOver), t.off("mouseout", this._hideIndicator);
}, e.prototype._applyTransform = function(t, n, a, i) {
var o = pi(n, i ? null : this.group);
return z(t) ? kr(t, o, a) : Xf(t, o, a);
}, e.prototype._dispatchHighDown = function(t, n) {
n && n.length && this.api.dispatchAction({
type: t,
batch: n
});
}, e.prototype.dispose = function() {
this._clearHoverLinkFromSeries(), this._clearHoverLinkToSeries();
}, e.type = "visualMap.continuous", e;
}(eL)
);
function Kw(r, e, t, n) {
return new Fe({
shape: {
points: r
},
draggable: !!t,
cursor: e,
drift: t,
onmousemove: function(a) {
Dn(a.event);
},
ondragend: n
});
}
function hU(r, e, t) {
var n = sU / 2, a = r.get("hoverLinkDataSize");
return a && (n = Yr(a, e, t, !0) / 2), n;
}
function jw(r) {
var e = r.get("hoverLinkOnHandle");
return !!(e ?? r.get("realtime"));
}
function Qw(r) {
return r === "vertical" ? "ns-resize" : "ew-resize";
}
var fU = {
type: "selectDataRange",
event: "dataRangeSelected",
// FIXME use updateView appears wrong
update: "update"
}, cU = function(r, e) {
e.eachComponent({
mainType: "visualMap",
query: r
}, function(t) {
t.setSelected(r.selected);
});
}, vU = [
{
createOnAllSeries: !0,
reset: function(r, e) {
var t = [];
return e.eachComponent("visualMap", function(n) {
var a = r.pipelineContext;
!n.isTargetSeries(r) || a && a.large || t.push(N$(n.stateList, n.targetVisuals, Y(n.getValueState, n), n.getDataDimensionIndex(r.getData())));
}), t;
}
},
// Only support color.
{
createOnAllSeries: !0,
reset: function(r, e) {
var t = r.getData(), n = [];
e.eachComponent("visualMap", function(a) {
if (a.isTargetSeries(r)) {
var i = a.getVisualMeta(Y(pU, null, r, a)) || {
stops: [],
outerColors: []
}, o = a.getDataDimensionIndex(t);
o >= 0 && (i.dimension = o, n.push(i));
}
}), r.getData().setVisual("visualMeta", n);
}
}
];
function pU(r, e, t, n) {
for (var a = e.targetVisuals[n], i = ce.prepareVisualTypes(a), o = {
color: Wl(r.getData(), "color")
// default color.
}, s = 0, l = i.length; s < l; s++) {
var u = i[s], h = a[u === "opacity" ? "__alphaForOpacity" : u];
h && h.applyVisual(t, f, c);
}
return o.color;
function f(v) {
return o[v];
}
function c(v, p) {
o[v] = p;
}
}
var Jw = A;
function dU(r) {
var e = r && r.visualMap;
z(e) || (e = e ? [e] : []), Jw(e, function(t) {
if (t) {
io(t, "splitList") && !io(t, "pieces") && (t.pieces = t.splitList, delete t.splitList);
var n = t.pieces;
n && z(n) && Jw(n, function(a) {
J(a) && (io(a, "start") && !io(a, "min") && (a.min = a.start), io(a, "end") && !io(a, "max") && (a.max = a.end));
});
}
});
}
function io(r, e) {
return r && r.hasOwnProperty && r.hasOwnProperty(e);
}
var tT = !1;
function nL(r) {
tT || (tT = !0, r.registerSubTypeDefaulter("visualMap", function(e) {
return !e.categories && (!(e.pieces ? e.pieces.length > 0 : e.splitNumber > 0) || e.calculable) ? "continuous" : "piecewise";
}), r.registerAction(fU, cU), A(vU, function(e) {
r.registerVisual(r.PRIORITY.VISUAL.COMPONENT, e);
}), r.registerPreprocessor(dU));
}
function aL(r) {
r.registerComponentModel(iU), r.registerComponentView(uU), nL(r);
}
var gU = (
/** @class */
function(r) {
O(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t.type = e.type, t._pieceList = [], t;
}
return e.prototype.optionUpdated = function(t, n) {
r.prototype.optionUpdated.apply(this, arguments), this.resetExtent();
var a = this._mode = this._determineMode();
this._pieceList = [], yU[this._mode].call(this, this._pieceList), this._resetSelected(t, n);
var i = this.option.categories;
this.resetVisual(function(o, s) {
a === "categories" ? (o.mappingMethod = "category", o.categories = nt(i)) : (o.dataExtent = this.getExtent(), o.mappingMethod = "piecewise", o.pieceList = G(this._pieceList, function(l) {
return l = nt(l), s !== "inRange" && (l.visual = null), l;
}));
});
}, e.prototype.completeVisualOption = function() {
var t = this.option, n = {}, a = ce.listVisualTypes(), i = this.isCategory();
A(t.pieces, function(s) {
A(a, function(l) {
s.hasOwnProperty(l) && (n[l] = 1);
});
}), A(n, function(s, l) {
var u = !1;
A(this.stateList, function(h) {
u = u || o(t, h, l) || o(t.target, h, l);
}, this), !u && A(this.stateList, function(h) {
(t[h] || (t[h] = {}))[l] = tL.get(l, h === "inRange" ? "active" : "inactive", i);
});
}, this);
function o(s, l, u) {
return s && s[l] && s[l].hasOwnProperty(u);
}
r.prototype.completeVisualOption.apply(this, arguments);
}, e.prototype._resetSelected = function(t, n) {
var a = this.option, i = this._pieceList, o = (n ? a : t).selected || {};
if (a.selected = o, A(i, function(l, u) {
var h = this.getSelectedMapKey(l);
o.hasOwnProperty(h) || (o[h] = !0);
}, this), a.selectedMode === "single") {
var s = !1;
A(i, function(l, u) {
var h = this.getSelectedMapKey(l);
o[h] && (s ? o[h] = !1 : s = !0);
}, this);
}
}, e.prototype.getItemSymbol = function() {
return this.get("itemSymbol");
}, e.prototype.getSelectedMapKey = function(t) {
return this._mode === "categories" ? t.value + "" : t.index + "";
}, e.prototype.getPieceList = function() {
return this._pieceList;
}, e.prototype._determineMode = function() {
var t = this.option;
return t.pieces && t.pieces.length > 0 ? "pieces" : this.option.categories ? "categories" : "splitNumber";
}, e.prototype.setSelected = function(t) {
this.option.selected = nt(t);
}, e.prototype.getValueState = function(t) {
var n = ce.findPieceIndex(t, this._pieceList);
return n != null && this.option.selected[this.getSelectedMapKey(this._pieceList[n])] ? "inRange" : "outOfRange";
}, e.prototype.findTargetDataIndices = function(t) {
var n = [], a = this._pieceList;
return this.eachTargetSeries(function(i) {
var o = [], s = i.getData();
s.each(this.getDataDimensionIndex(s), function(l, u) {
var h = ce.findPieceIndex(l, a);
h === t && o.push(u);
}, this), n.push({
seriesId: i.id,
dataIndex: o
});
}, this), n;
}, e.prototype.getRepresentValue = function(t) {
var n;
if (this.isCategory())
n = t.value;
else if (t.value != null)
n = t.value;
else {
var a = t.interval || [];
n = a[0] === -1 / 0 && a[1] === 1 / 0 ? 0 : (a[0] + a[1]) / 2;
}
return n;
}, e.prototype.getVisualMeta = function(t) {
if (this.isCategory())
return;
var n = [], a = ["", ""], i = this;
function o(h, f) {
var c = i.getRepresentValue({
interval: h
});
f || (f = i.getValueState(c));
var v = t(c, f);
h[0] === -1 / 0 ? a[0] = v : h[1] === 1 / 0 ? a[1] = v : n.push({
value: h[0],
color: v
}, {
value: h[1],
color: v
});
}
var s = this._pieceList.slice();
if (!s.length)
s.push({
interval: [-1 / 0, 1 / 0]
});
else {
var l = s[0].interval[0];
l !== -1 / 0 && s.unshift({
interval: [-1 / 0, l]
}), l = s[s.length - 1].interval[1], l !== 1 / 0 && s.push({
interval: [l, 1 / 0]
});
}
var u = -1 / 0;
return A(s, function(h) {
var f = h.interval;
f && (f[0] > u && o([u, f[0]], "outOfRange"), o(f.slice()), u = f[1]);
}, this), {
stops: n,
outerColors: a
};
}, e.type = "visualMap.piecewise", e.defaultOption = _a(bf.defaultOption, {
selected: null,
minOpen: !1,
maxOpen: !1,
align: "auto",
itemWidth: 20,
itemHeight: 14,
itemSymbol: "roundRect",
pieces: null,
categories: null,
splitNumber: 5,
selectedMode: "multiple",
itemGap: 10,
hoverLink: !0
// Enable hover highlight.
}), e;
}(bf)
), yU = {
splitNumber: function(r) {
var e = this.option, t = Math.min(e.precision, 20), n = this.getExtent(), a = e.splitNumber;
a = Math.max(parseInt(a, 10), 1), e.splitNumber = a;
for (var i = (n[1] - n[0]) / a; +i.toFixed(t) !== i && t < 5; )
t++;
e.precision = t, i = +i.toFixed(t), e.minOpen && r.push({
interval: [-1 / 0, n[0]],
close: [0, 0]
});
for (var o = 0, s = n[0]; o < a; s += i, o++) {
var l = o === a - 1 ? n[1] : s + i;
r.push({
interval: [s, l],
close: [1, 1]
});
}
e.maxOpen && r.push({
interval: [n[1], 1 / 0],
close: [0, 0]
}), F0(r), A(r, function(u, h) {
u.index = h, u.text = this.formatValueText(u.interval);
}, this);
},
categories: function(r) {
var e = this.option;
A(e.categories, function(t) {
r.push({
text: this.formatValueText(t, !0),
value: t
});
}, this), eT(e, r);
},
pieces: function(r) {
var e = this.option;
A(e.pieces, function(t, n) {
J(t) || (t = {
value: t
});
var a = {
text: "",
index: n
};
if (t.label != null && (a.text = t.label), t.hasOwnProperty("value")) {
var i = a.value = t.value;
a.interval = [i, i], a.close = [1, 1];
} else {
for (var o = a.interval = [], s = a.close = [0, 0], l = [1, 0, 1], u = [-1 / 0, 1 / 0], h = [], f = 0; f < 2; f++) {
for (var c = [["gte", "gt", "min"], ["lte", "lt", "max"]][f], v = 0; v < 3 && o[f] == null; v++)
o[f] = t[c[v]], s[f] = l[v], h[f] = v === 2;
o[f] == null && (o[f] = u[f]);
}
h[0] && o[1] === 1 / 0 && (s[0] = 0), h[1] && o[0] === -1 / 0 && (s[1] = 0), process.env.NODE_ENV !== "production" && o[0] > o[1] && console.warn("Piece " + n + "is illegal: " + o + " lower bound should not greater then uppper bound."), o[0] === o[1] && s[0] && s[1] && (a.value = o[0]);
}
a.visual = ce.retrieveVisuals(t), r.push(a);
}, this), eT(e, r), F0(r), A(r, function(t) {
var n = t.close, a = [["<", "≤"][n[1]], [">", "≥"][n[0]]];
t.text = t.text || this.formatValueText(t.value != null ? t.value : t.interval, !1, a);
}, this);
}
};
function eT(r, e) {
var t = r.inverse;
(r.orient === "vertical" ? !t : t) && e.reverse();
}
var mU = (
/** @class */
function(r) {
O(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t.type = e.type, t;
}
return e.prototype.doRender = function() {
var t = this.group;
t.removeAll();
var n = this.visualMapModel, a = n.get("textGap"), i = n.textStyleModel, o = i.getFont(), s = i.getTextColor(), l = this._getItemAlign(), u = n.itemSize, h = this._getViewData(), f = h.endsText, c = re(n.get("showLabel", !0), !f), v = !n.get("selectedMode");
f && this._renderEndsText(t, f[0], u, c, l), A(h.viewPieceList, function(p) {
var d = p.piece, g = new at();
g.onclick = Y(this._onItemClick, this, d), this._enableHoverLink(g, p.indexInModelPieceList);
var y = n.getRepresentValue(d);
if (this._createItemSymbol(g, y, [0, 0, u[0], u[1]], v), c) {
var m = this.visualMapModel.getValueState(y);
g.add(new wt({
style: {
x: l === "right" ? -a : u[0] + a,
y: u[1] / 2,
text: d.text,
verticalAlign: "middle",
align: l,
font: o,
fill: s,
opacity: m === "outOfRange" ? 0.5 : 1
},
silent: v
}));
}
t.add(g);
}, this), f && this._renderEndsText(t, f[1], u, c, l), di(n.get("orient"), t, n.get("itemGap")), this.renderBackground(t), this.positionGroup(t);
}, e.prototype._enableHoverLink = function(t, n) {
var a = this;
t.on("mouseover", function() {
return i("highlight");
}).on("mouseout", function() {
return i("downplay");
});
var i = function(o) {
var s = a.visualMapModel;
s.option.hoverLink && a.api.dispatchAction({
type: o,
batch: Th(s.findTargetDataIndices(n), s)
});
};
}, e.prototype._getItemAlign = function() {
var t = this.visualMapModel, n = t.option;
if (n.orient === "vertical")
return rL(t, this.api, t.itemSize);
var a = n.align;
return (!a || a === "auto") && (a = "left"), a;
}, e.prototype._renderEndsText = function(t, n, a, i, o) {
if (n) {
var s = new at(), l = this.visualMapModel.textStyleModel;
s.add(new wt({
style: Gt(l, {
x: i ? o === "right" ? a[0] : 0 : a[0] / 2,
y: a[1] / 2,
verticalAlign: "middle",
align: i ? o : "center",
text: n
})
})), t.add(s);
}
}, e.prototype._getViewData = function() {
var t = this.visualMapModel, n = G(t.getPieceList(), function(s, l) {
return {
piece: s,
indexInModelPieceList: l
};
}), a = t.get("text"), i = t.get("orient"), o = t.get("inverse");
return (i === "horizontal" ? o : !o) ? n.reverse() : a && (a = a.slice().reverse()), {
viewPieceList: n,
endsText: a
};
}, e.prototype._createItemSymbol = function(t, n, a, i) {
var o = ae(
// symbol will be string
this.getControllerVisual(n, "symbol"),
a[0],
a[1],
a[2],
a[3],
// color will be string
this.getControllerVisual(n, "color")
);
o.silent = i, t.add(o);
}, e.prototype._onItemClick = function(t) {
var n = this.visualMapModel, a = n.option, i = a.selectedMode;
if (i) {
var o = nt(a.selected), s = n.getSelectedMapKey(t);
i === "single" || i === !0 ? (o[s] = !0, A(o, function(l, u) {
o[u] = u === s;
})) : o[s] = !o[s], this.api.dispatchAction({
type: "selectDataRange",
from: this.uid,
visualMapId: this.visualMapModel.id,
selected: o
});
}
}, e.type = "visualMap.piecewise", e;
}(eL)
);
function iL(r) {
r.registerComponentModel(gU), r.registerComponentView(mU), nL(r);
}
function _U(r) {
gt(aL), gt(iL);
}
var SU = {
label: {
enabled: !0
},
decal: {
show: !1
}
}, rT = bt(), xU = {};
function bU(r, e) {
var t = r.getModel("aria");
if (!t.get("enabled"))
return;
var n = nt(SU);
ht(n.label, r.getLocaleModel().get("aria"), !1), ht(t.option, n, !1), a(), i();
function a() {
var u = t.getModel("decal"), h = u.get("show");
if (h) {
var f = X();
r.eachSeries(function(c) {
if (!c.isColorBySeries()) {
var v = f.get(c.type);
v || (v = {}, f.set(c.type, v)), rT(c).scope = v;
}
}), r.eachRawSeries(function(c) {
if (r.isSeriesFiltered(c))
return;
if (K(c.enableAriaDecal)) {
c.enableAriaDecal();
return;
}
var v = c.getData();
if (c.isColorBySeries()) {
var m = Od(c.ecModel, c.name, xU, r.getSeriesCount()), _ = v.getVisual("decal");
v.setVisual("decal", S(_, m));
} else {
var p = c.getRawData(), d = {}, g = rT(c).scope;
v.each(function(x) {
var b = v.getRawIndex(x);
d[b] = x;
});
var y = p.count();
p.each(function(x) {
var b = d[x], w = p.getName(x) || x + "", T = Od(c.ecModel, w, g, y), C = v.getItemVisual(b, "decal");
v.setItemVisual(b, "decal", S(C, T));
});
}
function S(x, b) {
var w = x ? B(B({}, b), x) : b;
return w.dirty = !0, w;
}
});
}
}
function i() {
var u = e.getZr().dom;
if (u) {
var h = r.getLocaleModel().get("aria"), f = t.getModel("label");
if (f.option = et(f.option, h), !!f.get("enabled")) {
if (u.setAttribute("role", "img"), f.get("description")) {
u.setAttribute("aria-label", f.get("description"));
return;
}
var c = r.getSeriesCount(), v = f.get(["data", "maxCount"]) || 10, p = f.get(["series", "maxCount"]) || 10, d = Math.min(c, p), g;
if (!(c < 1)) {
var y = s();
if (y) {
var m = f.get(["general", "withTitle"]);
g = o(m, {
title: y
});
} else
g = f.get(["general", "withoutTitle"]);
var _ = [], S = c > 1 ? f.get(["series", "multiple", "prefix"]) : f.get(["series", "single", "prefix"]);
g += o(S, {
seriesCount: c
}), r.eachSeries(function(T, C) {
if (C < d) {
var D = void 0, M = T.get("name"), I = M ? "withName" : "withoutName";
D = c > 1 ? f.get(["series", "multiple", I]) : f.get(["series", "single", I]), D = o(D, {
seriesId: T.seriesIndex,
seriesName: T.get("name"),
seriesType: l(T.subType)
});
var L = T.getData();
if (L.count() > v) {
var E = f.get(["data", "partialData"]);
D += o(E, {
displayCnt: v
});
} else
D += f.get(["data", "allData"]);
for (var P = f.get(["data", "separator", "middle"]), k = f.get(["data", "separator", "end"]), N = f.get(["data", "excludeDimensionId"]), R = [], V = 0; V < L.count(); V++)
if (V < v) {
var F = L.getName(V), H = N ? At(L.getValues(V), function(j, Q) {
return pt(N, Q) === -1;
}) : L.getValues(V), $ = f.get(["data", F ? "withName" : "withoutName"]);
R.push(o($, {
name: F,
value: H.join(P)
}));
}
D += R.join(P) + k, _.push(D);
}
});
var x = f.getModel(["series", "multiple", "separator"]), b = x.get("middle"), w = x.get("end");
g += _.join(b) + w, u.setAttribute("aria-label", g);
}
}
}
}
function o(u, h) {
if (!U(u))
return u;
var f = u;
return A(h, function(c, v) {
f = f.replace(new RegExp("\\{\\s*" + v + "\\s*\\}", "g"), c);
}), f;
}
function s() {
var u = r.get("title");
return u && u.length && (u = u[0]), u && u.text;
}
function l(u) {
var h = r.getLocaleModel().get(["series", "typeNames"]);
return h[u] || h.chart;
}
}
function wU(r) {
if (!(!r || !r.aria)) {
var e = r.aria;
e.show != null && (e.enabled = e.show), e.label = e.label || {}, A(["description", "general", "series", "data"], function(t) {
e[t] != null && (e.label[t] = e[t]);
});
}
}
function TU(r) {
r.registerPreprocessor(wU), r.registerVisual(r.PRIORITY.VISUAL.ARIA, bU);
}
var nT = {
value: "eq",
// PENDING: not good for literal semantic?
"<": "lt",
"<=": "lte",
">": "gt",
">=": "gte",
"=": "eq",
"!=": "ne",
"<>": "ne"
// Might be misleading for sake of the difference between '==' and '===',
// so don't support them.
// '==': 'eq',
// '===': 'seq',
// '!==': 'sne'
// PENDING: Whether support some common alias "ge", "le", "neq"?
// ge: 'gte',
// le: 'lte',
// neq: 'ne',
}, CU = (
/** @class */
function() {
function r(e) {
var t = this._condVal = U(e) ? new RegExp(e) : OT(e) ? e : null;
if (t == null) {
var n = "";
process.env.NODE_ENV !== "production" && (n = Be("Illegal regexp", e, "in")), Dt(n);
}
}
return r.prototype.evaluate = function(e) {
var t = typeof e;
return U(t) ? this._condVal.test(e) : Tt(t) ? this._condVal.test(e + "") : !1;
}, r;
}()
), DU = (
/** @class */
function() {
function r() {
}
return r.prototype.evaluate = function() {
return this.value;
}, r;
}()
), AU = (
/** @class */
function() {
function r() {
}
return r.prototype.evaluate = function() {
for (var e = this.children, t = 0; t < e.length; t++)
if (!e[t].evaluate())
return !1;
return !0;
}, r;
}()
), MU = (
/** @class */
function() {
function r() {
}
return r.prototype.evaluate = function() {
for (var e = this.children, t = 0; t < e.length; t++)
if (e[t].evaluate())
return !0;
return !1;
}, r;
}()
), IU = (
/** @class */
function() {
function r() {
}
return r.prototype.evaluate = function() {
return !this.child.evaluate();
}, r;
}()
), LU = (
/** @class */
function() {
function r() {
}
return r.prototype.evaluate = function() {
for (var e = !!this.valueParser, t = this.getValue, n = t(this.valueGetterParam), a = e ? this.valueParser(n) : null, i = 0; i < this.subCondList.length; i++)
if (!this.subCondList[i].evaluate(e ? a : n))
return !1;
return !0;
}, r;
}()
);
function t0(r, e) {
if (r === !0 || r === !1) {
var t = new DU();
return t.value = r, t;
}
var n = "";
return oL(r) || (process.env.NODE_ENV !== "production" && (n = Be("Illegal config. Expect a plain object but actually", r)), Dt(n)), r.and ? aT("and", r, e) : r.or ? aT("or", r, e) : r.not ? EU(r, e) : PU(r, e);
}
function aT(r, e, t) {
var n = e[r], a = "";
process.env.NODE_ENV !== "production" && (a = Be('"and"/"or" condition should only be `' + r + ": [...]` and must not be empty array.", "Illegal condition:", e)), z(n) || Dt(a), n.length || Dt(a);
var i = r === "and" ? new AU() : new MU();
return i.children = G(n, function(o) {
return t0(o, t);
}), i.children.length || Dt(a), i;
}
function EU(r, e) {
var t = r.not, n = "";
process.env.NODE_ENV !== "production" && (n = Be('"not" condition should only be `not: {}`.', "Illegal condition:", r)), oL(t) || Dt(n);
var a = new IU();
return a.child = t0(t, e), a.child || Dt(n), a;
}
function PU(r, e) {
for (var t = "", n = e.prepareGetValue(r), a = [], i = St(r), o = r.parser, s = o ? FD(o) : null, l = 0; l < i.length; l++) {
var u = i[l];
if (!(u === "parser" || e.valueGetterAttrMap.get(u))) {
var h = Z(nT, u) ? nT[u] : u, f = r[u], c = s ? s(f) : f, v = _O(h, c) || h === "reg" && new CU(c);
v || (process.env.NODE_ENV !== "production" && (t = Be('Illegal relational operation: "' + u + '" in condition:', r)), Dt(t)), a.push(v);
}
}
a.length || (process.env.NODE_ENV !== "production" && (t = Be("Relational condition must have at least one operator.", "Illegal condition:", r)), Dt(t));
var p = new LU();
return p.valueGetterParam = n, p.valueParser = s, p.getValue = e.getValue, p.subCondList = a, p;
}
function oL(r) {
return J(r) && !De(r);
}
var kU = (
/** @class */
function() {
function r(e, t) {
this._cond = t0(e, t);
}
return r.prototype.evaluate = function() {
return this._cond.evaluate();
}, r;
}()
);
function RU(r, e) {
return new kU(r, e);
}
var NU = {
type: "echarts:filter",
// PENDING: enhance to filter by index rather than create new data
transform: function(r) {
for (var e = r.upstream, t, n = RU(r.config, {
valueGetterAttrMap: X({
dimension: !0
}),
prepareGetValue: function(s) {
var l = "", u = s.dimension;
Z(s, "dimension") || (process.env.NODE_ENV !== "production" && (l = Be('Relation condition must has prop "dimension" specified.', "Illegal condition:", s)), Dt(l));
var h = e.getDimensionInfo(u);
return h || (process.env.NODE_ENV !== "production" && (l = Be("Can not find dimension info via: " + u + `.
`, "Existing dimensions: ", e.cloneAllDimensionInfo(), `.
`, "Illegal condition:", s, `.
`)), Dt(l)), {
dimIdx: h.index
};
},
getValue: function(s) {
return e.retrieveValueFromItem(t, s.dimIdx);
}
}), a = [], i = 0, o = e.count(); i < o; i++)
t = e.getRawDataItem(i), n.evaluate() && a.push(t);
return {
data: a
};
}
}, Og = "";
process.env.NODE_ENV !== "production" && (Og = ["Valid config is like:", '{ dimension: "age", order: "asc" }', 'or [{ dimension: "age", order: "asc"], { dimension: "date", order: "desc" }]'].join(" "));
var OU = {
type: "echarts:sort",
transform: function(r) {
var e = r.upstream, t = r.config, n = "", a = Pt(t);
a.length || (process.env.NODE_ENV !== "production" && (n = "Empty `config` in sort transform."), Dt(n));
var i = [];
A(a, function(h) {
var f = h.dimension, c = h.order, v = h.parser, p = h.incomparable;
if (f == null && (process.env.NODE_ENV !== "production" && (n = 'Sort transform config must has "dimension" specified.' + Og), Dt(n)), c !== "asc" && c !== "desc" && (process.env.NODE_ENV !== "production" && (n = 'Sort transform config must has "order" specified.' + Og), Dt(n)), p && p !== "min" && p !== "max") {
var d = "";
process.env.NODE_ENV !== "production" && (d = 'incomparable must be "min" or "max" rather than "' + p + '".'), Dt(d);
}
if (c !== "asc" && c !== "desc") {
var g = "";
process.env.NODE_ENV !== "production" && (g = 'order must be "asc" or "desc" rather than "' + c + '".'), Dt(g);
}
var y = e.getDimensionInfo(f);
y || (process.env.NODE_ENV !== "production" && (n = Be("Can not find dimension info via: " + f + `.
`, "Existing dimensions: ", e.cloneAllDimensionInfo(), `.
`, "Illegal config:", h, `.
`)), Dt(n));
var m = v ? FD(v) : null;
v && !m && (process.env.NODE_ENV !== "production" && (n = Be("Invalid parser name " + v + `.
`, "Illegal config:", h, `.
`)), Dt(n)), i.push({
dimIdx: y.index,
parser: m,
comparator: new WD(c, p)
});
});
var o = e.sourceFormat;
o !== Ae && o !== wr && (process.env.NODE_ENV !== "production" && (n = 'sourceFormat "' + o + '" is not supported yet'), Dt(n));
for (var s = [], l = 0, u = e.count(); l < u; l++)
s.push(e.getRawDataItem(l));
return s.sort(function(h, f) {
for (var c = 0; c < i.length; c++) {
var v = i[c], p = e.retrieveValueFromItem(h, v.dimIdx), d = e.retrieveValueFromItem(f, v.dimIdx);
v.parser && (p = v.parser(p), d = v.parser(d));
var g = v.comparator.evaluate(p, d);
if (g !== 0)
return g;
}
return 0;
}), {
data: s
};
}
};
function VU(r) {
r.registerTransform(NU), r.registerTransform(OU);
}
var BU = (
/** @class */
function(r) {
O(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t.type = "dataset", t;
}
return e.prototype.init = function(t, n, a) {
r.prototype.init.call(this, t, n, a), this._sourceManager = new ZD(this), r1(this);
}, e.prototype.mergeOption = function(t, n) {
r.prototype.mergeOption.call(this, t, n), r1(this);
}, e.prototype.optionUpdated = function() {
this._sourceManager.dirty();
}, e.prototype.getSourceManager = function() {
return this._sourceManager;
}, e.type = "dataset", e.defaultOption = {
seriesLayoutBy: en
}, e;
}(_t)
), zU = (
/** @class */
function(r) {
O(e, r);
function e() {
var t = r !== null && r.apply(this, arguments) || this;
return t.type = "dataset", t;
}
return e.type = "dataset", e;
}(Yt)
);
function GU(r) {
r.registerComponentModel(BU), r.registerComponentView(zU);
}
var Wr = sn.CMD;
function yo(r, e) {
return Math.abs(r - e) < 1e-5;
}
function Vg(r) {
var e = r.data, t = r.len(), n = [], a, i = 0, o = 0, s = 0, l = 0;
function u(L, E) {
a && a.length > 2 && n.push(a), a = [L, E];
}
function h(L, E, P, k) {
yo(L, P) && yo(E, k) || a.push(L, E, P, k, P, k);
}
function f(L, E, P, k, N, R) {
var V = Math.abs(E - L), F = Math.tan(V / 4) * 4 / 3, H = E < L ? -1 : 1, $ = Math.cos(L), j = Math.sin(L), Q = Math.cos(E), st = Math.sin(E), Et = $ * N + P, qt = j * R + k, vt = Q * N + P, rt = st * R + k, dt = N * F * H, q = R * F * H;
a.push(Et - dt * j, qt + q * $, vt + dt * st, rt - q * Q, vt, rt);
}
for (var c, v, p, d, g = 0; g < t; ) {
var y = e[g++], m = g === 1;
switch (m && (i = e[g], o = e[g + 1], s = i, l = o, (y === Wr.L || y === Wr.C || y === Wr.Q) && (a = [s, l])), y) {
case Wr.M:
i = s = e[g++], o = l = e[g++], u(s, l);
break;
case Wr.L:
c = e[g++], v = e[g++], h(i, o, c, v), i = c, o = v;
break;
case Wr.C:
a.push(e[g++], e[g++], e[g++], e[g++], i = e[g++], o = e[g++]);
break;
case Wr.Q:
c = e[g++], v = e[g++], p = e[g++], d = e[g++], a.push(i + 2 / 3 * (c - i), o + 2 / 3 * (v - o), p + 2 / 3 * (c - p), d + 2 / 3 * (v - d), p, d), i = p, o = d;
break;
case Wr.A:
var _ = e[g++], S = e[g++], x = e[g++], b = e[g++], w = e[g++], T = e[g++] + w;
g += 1;
var C = !e[g++];
c = Math.cos(w) * x + _, v = Math.sin(w) * b + S, m ? (s = c, l = v, u(s, l)) : h(i, o, c, v), i = Math.cos(T) * x + _, o = Math.sin(T) * b + S;
for (var D = (C ? -1 : 1) * Math.PI / 2, M = w; C ? M > T : M < T; M += D) {
var I = C ? Math.max(M + D, T) : Math.min(M + D, T);
f(M, I, _, S, x, b);
}
break;
case Wr.R:
s = i = e[g++], l = o = e[g++], c = s + e[g++], v = l + e[g++], u(c, l), h(c, l, c, v), h(c, v, s, v), h(s, v, s, l), h(s, l, c, l);
break;
case Wr.Z:
a && h(i, o, s, l), i = s, o = l;
break;
}
}
return a && a.length > 2 && n.push(a), n;
}
function Bg(r, e, t, n, a, i, o, s, l, u) {
if (yo(r, t) && yo(e, n) && yo(a, o) && yo(i, s)) {
l.push(o, s);
return;
}
var h = 2 / u, f = h * h, c = o - r, v = s - e, p = Math.sqrt(c * c + v * v);
c /= p, v /= p;
var d = t - r, g = n - e, y = a - o, m = i - s, _ = d * d + g * g, S = y * y + m * m;
if (_ < f && S < f) {
l.push(o, s);
return;
}
var x = c * d + v * g, b = -c * y - v * m, w = _ - x * x, T = S - b * b;
if (w < f && x >= 0 && T < f && b >= 0) {
l.push(o, s);
return;
}
var C = [], D = [];
fa(r, t, a, o, 0.5, C), fa(e, n, i, s, 0.5, D), Bg(C[0], D[0], C[1], D[1], C[2], D[2], C[3], D[3], l, u), Bg(C[4], D[4], C[5], D[5], C[6], D[6], C[7], D[7], l, u);
}
function FU(r, e) {
var t = Vg(r), n = [];
e = e || 1;
for (var a = 0; a < t.length; a++) {
var i = t[a], o = [], s = i[0], l = i[1];
o.push(s, l);
for (var u = 2; u < i.length; ) {
var h = i[u++], f = i[u++], c = i[u++], v = i[u++], p = i[u++], d = i[u++];
Bg(s, l, h, f, c, v, p, d, o, e), s = p, l = d;
}
n.push(o);
}
return n;
}
function sL(r, e, t) {
var n = r[e], a = r[1 - e], i = Math.abs(n / a), o = Math.ceil(Math.sqrt(i * t)), s = Math.floor(t / o);
s === 0 && (s = 1, o = t);
for (var l = [], u = 0; u < o; u++)
l.push(s);
var h = o * s, f = t - h;
if (f > 0)
for (var u = 0; u < f; u++)
l[u % o] += 1;
return l;
}
function iT(r, e, t) {
for (var n = r.r0, a = r.r, i = r.startAngle, o = r.endAngle, s = Math.abs(o - i), l = s * a, u = a - n, h = l > Math.abs(u), f = sL([l, u], h ? 0 : 1, e), c = (h ? s : u) / f.length, v = 0; v < f.length; v++)
for (var p = (h ? u : s) / f[v], d = 0; d < f[v]; d++) {
var g = {};
h ? (g.startAngle = i + c * v, g.endAngle = i + c * (v + 1), g.r0 = n + p * d, g.r = n + p * (d + 1)) : (g.startAngle = i + p * d, g.endAngle = i + p * (d + 1), g.r0 = n + c * v, g.r = n + c * (v + 1)), g.clockwise = r.clockwise, g.cx = r.cx, g.cy = r.cy, t.push(g);
}
}
function HU(r, e, t) {
for (var n = r.width, a = r.height, i = n > a, o = sL([n, a], i ? 0 : 1, e), s = i ? "width" : "height", l = i ? "height" : "width", u = i ? "x" : "y", h = i ? "y" : "x", f = r[s] / o.length, c = 0; c < o.length; c++)
for (var v = r[l] / o[c], p = 0; p < o[c]; p++) {
var d = {};
d[u] = c * f, d[h] = p * v, d[s] = f, d[l] = v, d.x += r.x, d.y += r.y, t.push(d);
}
}
function oT(r, e, t, n) {
return r * n - t * e;
}
function WU(r, e, t, n, a, i, o, s) {
var l = t - r, u = n - e, h = o - a, f = s - i, c = oT(h, f, l, u);
if (Math.abs(c) < 1e-6)
return null;
var v = r - a, p = e - i, d = oT(v, p, h, f) / c;
return d < 0 || d > 1 ? null : new ft(d * l + r, d * u + e);
}
function $U(r, e, t) {
var n = new ft();
ft.sub(n, t, e), n.normalize();
var a = new ft();
ft.sub(a, r, e);
var i = a.dot(n);
return i;
}
function oo(r, e) {
var t = r[r.length - 1];
t && t[0] === e[0] && t[1] === e[1] || r.push(e);
}
function UU(r, e, t) {
for (var n = r.length, a = [], i = 0; i < n; i++) {
var o = r[i], s = r[(i + 1) % n], l = WU(o[0], o[1], s[0], s[1], e.x, e.y, t.x, t.y);
l && a.push({
projPt: $U(l, e, t),
pt: l,
idx: i
});
}
if (a.length < 2)
return [{ points: r }, { points: r }];
a.sort(function(g, y) {
return g.projPt - y.projPt;
});
var u = a[0], h = a[a.length - 1];
if (h.idx < u.idx) {
var f = u;
u = h, h = f;
}
for (var c = [u.pt.x, u.pt.y], v = [h.pt.x, h.pt.y], p = [c], d = [v], i = u.idx + 1; i <= h.idx; i++)
oo(p, r[i].slice());
oo(p, v), oo(p, c);
for (var i = h.idx + 1; i <= u.idx + n; i++)
oo(d, r[i % n].slice());
return oo(d, c), oo(d, v), [{
points: p
}, {
points: d
}];
}
function sT(r) {
var e = r.points, t = [], n = [];
Hf(e, t, n);
var a = new ct(t[0], t[1], n[0] - t[0], n[1] - t[1]), i = a.width, o = a.height, s = a.x, l = a.y, u = new ft(), h = new ft();
return i > o ? (u.x = h.x = s + i / 2, u.y = l, h.y = l + o) : (u.y = h.y = l + o / 2, u.x = s, h.x = s + i), UU(e, u, h);
}
function wf(r, e, t, n) {
if (t === 1)
n.push(e);
else {
var a = Math.floor(t / 2), i = r(e);
wf(r, i[0], a, n), wf(r, i[1], t - a, n);
}
return n;
}
function YU(r, e) {
for (var t = [], n = 0; n < e; n++)
t.push(my(r));
return t;
}
function ZU(r, e) {
e.setStyle(r.style), e.z = r.z, e.z2 = r.z2, e.zlevel = r.zlevel;
}
function XU(r) {
for (var e = [], t = 0; t < r.length; )
e.push([r[t++], r[t++]]);
return e;
}
function qU(r, e) {
var t = [], n = r.shape, a;
switch (r.type) {
case "rect":
HU(n, e, t), a = xt;
break;
case "sector":
iT(n, e, t), a = Ge;
break;
case "circle":
iT({
r0: 0,
r: n.r,
startAngle: 0,
endAngle: Math.PI * 2,
cx: n.cx,
cy: n.cy
}, e, t), a = Ge;
break;
default:
var i = r.getComputedTransform(), o = i ? Math.sqrt(Math.max(i[0] * i[0] + i[1] * i[1], i[2] * i[2] + i[3] * i[3])) : 1, s = G(FU(r.getUpdatedPathProxy(), o), function(y) {
return XU(y);
}), l = s.length;
if (l === 0)
wf(sT, {
points: s[0]
}, e, t);
else if (l === e)
for (var u = 0; u < l; u++)
t.push({
points: s[u]
});
else {
var h = 0, f = G(s, function(y) {
var m = [], _ = [];
Hf(y, m, _);
var S = (_[1] - m[1]) * (_[0] - m[0]);
return h += S, { poly: y, area: S };
});
f.sort(function(y, m) {
return m.area - y.area;
});
for (var c = e, u = 0; u < l; u++) {
var v = f[u];
if (c <= 0)
break;
var p = u === l - 1 ? c : Math.ceil(v.area / h * e);
p < 0 || (wf(sT, {
points: v.poly
}, p, t), c -= p);
}
}
a = Fe;
break;
}
if (!a)
return YU(r, e);
for (var d = [], u = 0; u < t.length; u++) {
var g = new a();
g.setShape(t[u]), ZU(r, g), d.push(g);
}
return d;
}
function KU(r, e) {
var t = r.length, n = e.length;
if (t === n)
return [r, e];
for (var a = [], i = [], o = t < n ? r : e, s = Math.min(t, n), l = Math.abs(n - t) / 6, u = (s - 2) / 6, h = Math.ceil(l / u) + 1, f = [o[0], o[1]], c = l, v = 2; v < s; ) {
var p = o[v - 2], d = o[v - 1], g = o[v++], y = o[v++], m = o[v++], _ = o[v++], S = o[v++], x = o[v++];
if (c <= 0) {
f.push(g, y, m, _, S, x);
continue;
}
for (var b = Math.min(c, h - 1) + 1, w = 1; w <= b; w++) {
var T = w / b;
fa(p, g, m, S, T, a), fa(d, y, _, x, T, i), p = a[3], d = i[3], f.push(a[1], i[1], a[2], i[2], p, d), g = a[5], y = i[5], m = a[6], _ = i[6];
}
c -= b - 1;
}
return o === r ? [f, e] : [r, f];
}
function lT(r, e) {
for (var t = r.length, n = r[t - 2], a = r[t - 1], i = [], o = 0; o < e.length; )
i[o++] = n, i[o++] = a;
return i;
}
function jU(r, e) {
for (var t, n, a, i = [], o = [], s = 0; s < Math.max(r.length, e.length); s++) {
var l = r[s], u = e[s], h = void 0, f = void 0;
l ? u ? (t = KU(l, u), h = t[0], f = t[1], n = h, a = f) : (f = lT(a || l, l), h = l) : (h = lT(n || u, u), f = u), i.push(h), o.push(f);
}
return [i, o];
}
function uT(r) {
for (var e = 0, t = 0, n = 0, a = r.length, i = 0, o = a - 2; i < a; o = i, i += 2) {
var s = r[o], l = r[o + 1], u = r[i], h = r[i + 1], f = s * h - u * l;
e += f, t += (s + u) * f, n += (l + h) * f;
}
return e === 0 ? [r[0] || 0, r[1] || 0] : [t / e / 3, n / e / 3, e];
}
function QU(r, e, t, n) {
for (var a = (r.length - 2) / 6, i = 1 / 0, o = 0, s = r.length, l = s - 2, u = 0; u < a; u++) {
for (var h = u * 6, f = 0, c = 0; c < s; c += 2) {
var v = c === 0 ? h : (h + c - 2) % l + 2, p = r[v] - t[0], d = r[v + 1] - t[1], g = e[c] - n[0], y = e[c + 1] - n[1], m = g - p, _ = y - d;
f += m * m + _ * _;
}
f < i && (i = f, o = u);
}
return o;
}
function JU(r) {
for (var e = [], t = r.length, n = 0; n < t; n += 2)
e[n] = r[t - n - 2], e[n + 1] = r[t - n - 1];
return e;
}
function tY(r, e, t, n) {
for (var a = [], i, o = 0; o < r.length; o++) {
var s = r[o], l = e[o], u = uT(s), h = uT(l);
i == null && (i = u[2] < 0 != h[2] < 0);
var f = [], c = [], v = 0, p = 1 / 0, d = [], g = s.length;
i && (s = JU(s));
for (var y = QU(s, l, u, h) * 6, m = g - 2, _ = 0; _ < m; _ += 2) {
var S = (y + _) % m + 2;
f[_ + 2] = s[S] - u[0], f[_ + 3] = s[S + 1] - u[1];
}
f[0] = s[y] - u[0], f[1] = s[y + 1] - u[1];
for (var x = n / t, b = -n / 2; b <= n / 2; b += x) {
for (var w = Math.sin(b), T = Math.cos(b), C = 0, _ = 0; _ < s.length; _ += 2) {
var D = f[_], M = f[_ + 1], I = l[_] - h[0], L = l[_ + 1] - h[1], E = I * T - L * w, P = I * w + L * T;
d[_] = E, d[_ + 1] = P;
var k = E - D, N = P - M;
C += k * k + N * N;
}
if (C < p) {
p = C, v = b;
for (var R = 0; R < d.length; R++)
c[R] = d[R];
}
}
a.push({
from: f,
to: c,
fromCp: u,
toCp: h,
rotation: -v
});
}
return a;
}
function Tf(r) {
return r.__isCombineMorphing;
}
var lL = "__mOriginal_";
function Cf(r, e, t) {
var n = lL + e, a = r[n] || r[e];
r[n] || (r[n] = r[e]);
var i = t.replace, o = t.after, s = t.before;
r[e] = function() {
var l = arguments, u;
return s && s.apply(this, l), i ? u = i.apply(this, l) : u = a.apply(this, l), o && o.apply(this, l), u;
};
}
function il(r, e) {
var t = lL + e;
r[t] && (r[e] = r[t], r[t] = null);
}
function hT(r, e) {
for (var t = 0; t < r.length; t++)
for (var n = r[t], a = 0; a < n.length; ) {
var i = n[a], o = n[a + 1];
n[a++] = e[0] * i + e[2] * o + e[4], n[a++] = e[1] * i + e[3] * o + e[5];
}
}
function uL(r, e) {
var t = r.getUpdatedPathProxy(), n = e.getUpdatedPathProxy(), a = jU(Vg(t), Vg(n)), i = a[0], o = a[1], s = r.getComputedTransform(), l = e.getComputedTransform();
function u() {
this.transform = null;
}
s && hT(i, s), l && hT(o, l), Cf(e, "updateTransform", { replace: u }), e.transform = null;
var h = tY(i, o, 10, Math.PI), f = [];
Cf(e, "buildPath", { replace: function(c) {
for (var v = e.__morphT, p = 1 - v, d = [], g = 0; g < h.length; g++) {
var y = h[g], m = y.from, _ = y.to, S = y.rotation * v, x = y.fromCp, b = y.toCp, w = Math.sin(S), T = Math.cos(S);
oh(d, x, b, v);
for (var C = 0; C < m.length; C += 2) {
var D = m[C], M = m[C + 1], I = _[C], L = _[C + 1], E = D * p + I * v, P = M * p + L * v;
f[C] = E * T - P * w + d[0], f[C + 1] = E * w + P * T + d[1];
}
var k = f[0], N = f[1];
c.moveTo(k, N);
for (var C = 2; C < m.length; ) {
var I = f[C++], L = f[C++], R = f[C++], V = f[C++], F = f[C++], H = f[C++];
k === I && N === L && R === F && V === H ? c.lineTo(F, H) : c.bezierCurveTo(I, L, R, V, F, H), k = F, N = H;
}
}
} });
}
function e0(r, e, t) {
if (!r || !e)
return e;
var n = t.done, a = t.during;
uL(r, e), e.__morphT = 0;
function i() {
il(e, "buildPath"), il(e, "updateTransform"), e.__morphT = -1, e.createPathProxy(), e.dirtyShape();
}
return e.animateTo({
__morphT: 1
}, et({
during: function(o) {
e.dirtyShape(), a && a(o);
},
done: function() {
i(), n && n();
}
}, t)), e;
}
function eY(r, e, t, n, a, i) {
var o = 16;
r = a === t ? 0 : Math.round(32767 * (r - t) / (a - t)), e = i === n ? 0 : Math.round(32767 * (e - n) / (i - n));
for (var s = 0, l, u = (1 << o) / 2; u > 0; u /= 2) {
var h = 0, f = 0;
(r & u) > 0 && (h = 1), (e & u) > 0 && (f = 1), s += u * u * (3 * h ^ f), f === 0 && (h === 1 && (r = u - 1 - r, e = u - 1 - e), l = r, r = e, e = l);
}
return s;
}
function Df(r) {
var e = 1 / 0, t = 1 / 0, n = -1 / 0, a = -1 / 0, i = G(r, function(s) {
var l = s.getBoundingRect(), u = s.getComputedTransform(), h = l.x + l.width / 2 + (u ? u[4] : 0), f = l.y + l.height / 2 + (u ? u[5] : 0);
return e = Math.min(h, e), t = Math.min(f, t), n = Math.max(h, n), a = Math.max(f, a), [h, f];
}), o = G(i, function(s, l) {
return {
cp: s,
z: eY(s[0], s[1], e, t, n, a),
path: r[l]
};
});
return o.sort(function(s, l) {
return s.z - l.z;
}).map(function(s) {
return s.path;
});
}
function hL(r) {
return qU(r.path, r.count);
}
function zg() {
return {
fromIndividuals: [],
toIndividuals: [],
count: 0
};
}
function rY(r, e, t) {
var n = [];
function a(x) {
for (var b = 0; b < x.length; b++) {
var w = x[b];
Tf(w) ? a(w.childrenRef()) : w instanceof mt && n.push(w);
}
}
a(r);
var i = n.length;
if (!i)
return zg();
var o = t.dividePath || hL, s = o({
path: e,
count: i
});
if (s.length !== i)
return console.error("Invalid morphing: unmatched splitted path"), zg();
n = Df(n), s = Df(s);
for (var l = t.done, u = t.during, h = t.individualDelay, f = new mn(), c = 0; c < i; c++) {
var v = n[c], p = s[c];
p.parent = e, p.copyTransform(f), h || uL(v, p);
}
e.__isCombineMorphing = !0, e.childrenRef = function() {
return s;
};
function d(x) {
for (var b = 0; b < s.length; b++)
s[b].addSelfToZr(x);
}
Cf(e, "addSelfToZr", {
after: function(x) {
d(x);
}
}), Cf(e, "removeSelfFromZr", {
after: function(x) {
for (var b = 0; b < s.length; b++)
s[b].removeSelfFromZr(x);
}
});
function g() {
e.__isCombineMorphing = !1, e.__morphT = -1, e.childrenRef = null, il(e, "addSelfToZr"), il(e, "removeSelfFromZr");
}
var y = s.length;
if (h)
for (var m = y, _ = function() {
m--, m === 0 && (g(), l && l());
}, c = 0; c < y; c++) {
var S = h ? et({
delay: (t.delay || 0) + h(c, y, n[c], s[c]),
done: _
}, t) : t;
e0(n[c], s[c], S);
}
else
e.__morphT = 0, e.animateTo({
__morphT: 1
}, et({
during: function(x) {
for (var b = 0; b < y; b++) {
var w = s[b];
w.__morphT = e.__morphT, w.dirtyShape();
}
u && u(x);
},
done: function() {
g();
for (var x = 0; x < r.length; x++)
il(r[x], "updateTransform");
l && l();
}
}, t));
return e.__zr && d(e.__zr), {
fromIndividuals: n,
toIndividuals: s,
count: y
};
}
function nY(r, e, t) {
var n = e.length, a = [], i = t.dividePath || hL;
function o(v) {
for (var p = 0; p < v.length; p++) {
var d = v[p];
Tf(d) ? o(d.childrenRef()) : d instanceof mt && a.push(d);
}
}
if (Tf(r)) {
o(r.childrenRef());
var s = a.length;
if (s < n)
for (var l = 0, u = s; u < n; u++)
a.push(my(a[l++ % s]));
a.length = n;
} else {
a = i({ path: r, count: n });
for (var h = r.getComputedTransform(), u = 0; u < a.length; u++)
a[u].setLocalTransform(h);
if (a.length !== n)
return console.error("Invalid morphing: unmatched splitted path"), zg();
}
a = Df(a), e = Df(e);
for (var f = t.individualDelay, u = 0; u < n; u++) {
var c = f ? et({
delay: (t.delay || 0) + f(u, n, a[u], e[u])
}, t) : t;
e0(a[u], e[u], c);
}
return {
fromIndividuals: a,
toIndividuals: e,
count: e.length
};
}
function fT(r) {
return z(r[0]);
}
function cT(r, e) {
for (var t = [], n = r.length, a = 0; a < n; a++)
t.push({
one: r[a],
many: []
});
for (var a = 0; a < e.length; a++) {
var i = e[a].length, o = void 0;
for (o = 0; o < i; o++)
t[o % n].many.push(e[a][o]);
}
for (var s = 0, a = n - 1; a >= 0; a--)
if (!t[a].many.length) {
var l = t[s].many;
if (l.length <= 1)
if (s)
s = 0;
else
return t;
var i = l.length, u = Math.ceil(i / 2);
t[a].many = l.slice(u, i), t[s].many = l.slice(0, u), s++;
}
return t;
}
var aY = {
clone: function(r) {
for (var e = [], t = 1 - Math.pow(1 - r.path.style.opacity, 1 / r.count), n = 0; n < r.count; n++) {
var a = my(r.path);
a.setStyle("opacity", t), e.push(a);
}
return e;
},
// Use the default divider
split: null
};
function Hp(r, e, t, n, a, i) {
if (!r.length || !e.length)
return;
var o = Go("update", n, a);
if (!(o && o.duration > 0))
return;
var s = n.getModel("universalTransition").get("delay"), l = Object.assign({
// Need to setToFinal so the further calculation based on the style can be correct.
// Like emphasis color.
setToFinal: !0
}, o), u, h;
fT(r) && (u = r, h = e), fT(e) && (u = e, h = r);
function f(y, m, _, S, x) {
var b = y.many, w = y.one;
if (b.length === 1 && !x) {
var T = m ? b[0] : w, C = m ? w : b[0];
if (Tf(T))
f({
many: [T],
one: C
}, !0, _, S, !0);
else {
var D = s ? et({
delay: s(_, S)
}, l) : l;
e0(T, C, D), i(T, C, T, C, D);
}
} else
for (var M = et({
dividePath: aY[t],
individualDelay: s && function(N, R, V, F) {
return s(N + _, S);
}
}, l), I = m ? rY(b, w, M) : nY(w, b, M), L = I.fromIndividuals, E = I.toIndividuals, P = L.length, k = 0; k < P; k++) {
var D = s ? et({
delay: s(k, P)
}, l) : l;
i(L[k], E[k], m ? b[k] : y.one, m ? y.one : b[k], D);
}
}
for (var c = u ? u === r : r.length > e.length, v = u ? cT(h, u) : cT(c ? e : r, [c ? r : e]), p = 0, d = 0; d < v.length; d++)
p += v[d].many.length;
for (var g = 0, d = 0; d < v.length; d++)
f(v[d], c, g, p), g += v[d].many.length;
}
function Ka(r) {
if (!r)
return [];
if (z(r)) {
for (var e = [], t = 0; t < r.length; t++)
e.push(Ka(r[t]));
return e;
}
var n = [];
return r.traverse(function(a) {
a instanceof mt && !a.disableMorphing && !a.invisible && !a.ignore && n.push(a);
}), n;
}
var fL = 1e4, iY = 0, vT = 1, pT = 2, oY = bt();
function sY(r, e) {
for (var t = r.dimensions, n = 0; n < t.length; n++) {
var a = r.getDimensionInfo(t[n]);
if (a && a.otherDims[e] === 0)
return t[n];
}
}
function lY(r, e, t) {
var n = r.getDimensionInfo(t), a = n && n.ordinalMeta;
if (n) {
var i = r.get(n.name, e);
return a && a.categories[i] || i + "";
}
}
function dT(r, e, t, n) {
var a = n ? "itemChildGroupId" : "itemGroupId", i = sY(r, a);
if (i) {
var o = lY(r, e, i);
return o;
}
var s = r.getRawDataItem(e), l = n ? "childGroupId" : "groupId";
if (s && s[l])
return s[l] + "";
if (!n)
return t || r.getId(e);
}
function gT(r) {
var e = [];
return A(r, function(t) {
var n = t.data, a = t.dataGroupId;
if (n.count() > fL) {
process.env.NODE_ENV !== "production" && Zt("Universal transition is disabled on large data > 10k.");
return;
}
for (var i = n.getIndices(), o = 0; o < i.length; o++)
e.push({
data: n,
groupId: dT(n, o, a, !1),
childGroupId: dT(n, o, a, !0),
divide: t.divide,
dataIndex: o
});
}), e;
}
function Wp(r, e, t) {
r.traverse(function(n) {
n instanceof mt && $t(n, {
style: {
opacity: 0
}
}, e, {
dataIndex: t,
isFrom: !0
});
});
}
function $p(r) {
if (r.parent) {
var e = r.getComputedTransform();
r.setLocalTransform(e), r.parent.remove(r);
}
}
function so(r) {
r.stopAnimation(), r.isGroup && r.traverse(function(e) {
e.stopAnimation();
});
}
function uY(r, e, t) {
var n = Go("update", t, e);
n && r.traverse(function(a) {
if (a instanceof Sr) {
var i = tN(a);
i && a.animateFrom({
style: i
}, n);
}
});
}
function hY(r, e) {
var t = r.length;
if (t !== e.length)
return !1;
for (var n = 0; n < t; n++) {
var a = r[n], i = e[n];
if (a.data.getId(a.dataIndex) !== i.data.getId(i.dataIndex))
return !1;
}
return !0;
}
function cL(r, e, t) {
var n = gT(r), a = gT(e);
function i(_, S, x, b, w) {
(x || _) && S.animateFrom({
style: x && x !== _ ? B(B({}, x.style), _.style) : _.style
}, w);
}
var o = !1, s = iY, l = X(), u = X();
n.forEach(function(_) {
_.groupId && l.set(_.groupId, !0), _.childGroupId && u.set(_.childGroupId, !0);
});
for (var h = 0; h < a.length; h++) {
var f = a[h].groupId;
if (u.get(f)) {
s = vT;
break;
}
var c = a[h].childGroupId;
if (c && l.get(c)) {
s = pT;
break;
}
}
function v(_, S) {
return function(x) {
var b = x.data, w = x.dataIndex;
return S ? b.getId(w) : _ ? s === vT ? x.childGroupId : x.groupId : s === pT ? x.childGroupId : x.groupId;
};
}
var p = hY(n, a), d = {};
if (!p)
for (var h = 0; h < a.length; h++) {
var g = a[h], y = g.data.getItemGraphicEl(g.dataIndex);
y && (d[y.id] = !0);
}
function m(_, S) {
var x = n[S], b = a[_], w = b.data.hostModel, T = x.data.getItemGraphicEl(x.dataIndex), C = b.data.getItemGraphicEl(b.dataIndex);
if (T === C) {
C && uY(C, b.dataIndex, w);
return;
}
// We can't use the elements that already being morphed
T && d[T.id] || C && (so(C), T ? (so(T), $p(T), o = !0, Hp(Ka(T), Ka(C), b.divide, w, _, i)) : Wp(C, w, _));
}
new Ln(n, a, v(!0, p), v(!1, p), null, "multiple").update(m).updateManyToOne(function(_, S) {
var x = a[_], b = x.data, w = b.hostModel, T = b.getItemGraphicEl(x.dataIndex), C = At(G(S, function(D) {
return n[D].data.getItemGraphicEl(n[D].dataIndex);
}), function(D) {
return D && D !== T && !d[D.id];
});
T && (so(T), C.length ? (A(C, function(D) {
so(D), $p(D);
}), o = !0, Hp(Ka(C), Ka(T), x.divide, w, _, i)) : Wp(T, w, x.dataIndex));
}).updateOneToMany(function(_, S) {
var x = n[S], b = x.data.getItemGraphicEl(x.dataIndex);
if (!(b && d[b.id])) {
var w = At(G(_, function(C) {
return a[C].data.getItemGraphicEl(a[C].dataIndex);
}), function(C) {
return C && C !== b;
}), T = a[_[0]].data.hostModel;
w.length && (A(w, function(C) {
return so(C);
}), b ? (so(b), $p(b), o = !0, Hp(
Ka(b),
Ka(w),
x.divide,
// Use divide on old.
T,
_[0],
i
)) : A(w, function(C) {
return Wp(C, T, _[0]);
}));
}
}).updateManyToMany(function(_, S) {
new Ln(S, _, function(x) {
return n[x].data.getId(n[x].dataIndex);
}, function(x) {
return a[x].data.getId(a[x].dataIndex);
}).update(function(x, b) {
m(_[x], S[b]);
}).execute();
}).execute(), o && A(e, function(_) {
var S = _.data, x = S.hostModel, b = x && t.getViewOfSeriesModel(x), w = Go("update", x, 0);
b && x.isAnimationEnabled() && w && w.duration > 0 && b.group.traverse(function(T) {
T instanceof mt && !T.animators.length && T.animateFrom({
style: {
opacity: 0
}
}, w);
});
});
}
function yT(r) {
var e = r.getModel("universalTransition").get("seriesKey");
return e || r.id;
}
function mT(r) {
return z(r) ? r.sort().join(",") : r;
}
function Kn(r) {
if (r.hostModel)
return r.hostModel.getModel("universalTransition").get("divideShape");
}
function fY(r, e) {
var t = X(), n = X(), a = X();
A(r.oldSeries, function(o, s) {
var l = r.oldDataGroupIds[s], u = r.oldData[s], h = yT(o), f = mT(h);
n.set(f, {
dataGroupId: l,
data: u
}), z(h) && A(h, function(c) {
a.set(c, {
key: f,
dataGroupId: l,
data: u
});
});
});
function i(o) {
t.get(o) && Zt("Duplicated seriesKey in universalTransition " + o);
}
return A(e.updatedSeries, function(o) {
if (o.isUniversalTransitionEnabled() && o.isAnimationEnabled()) {
var s = o.get("dataGroupId"), l = o.getData(), u = yT(o), h = mT(u), f = n.get(h);
if (f)
process.env.NODE_ENV !== "production" && i(h), t.set(h, {
oldSeries: [{
dataGroupId: f.dataGroupId,
divide: Kn(f.data),
data: f.data
}],
newSeries: [{
dataGroupId: s,
divide: Kn(l),
data: l
}]
});
else if (z(u)) {
process.env.NODE_ENV !== "production" && i(h);
var c = [];
A(u, function(d) {
var g = n.get(d);
g.data && c.push({
dataGroupId: g.dataGroupId,
divide: Kn(g.data),
data: g.data
});
}), c.length && t.set(h, {
oldSeries: c,
newSeries: [{
dataGroupId: s,
data: l,
divide: Kn(l)
}]
});
} else {
var v = a.get(u);
if (v) {
var p = t.get(v.key);
p || (p = {
oldSeries: [{
dataGroupId: v.dataGroupId,
data: v.data,
divide: Kn(v.data)
}],
newSeries: []
}, t.set(v.key, p)), p.newSeries.push({
dataGroupId: s,
data: l,
divide: Kn(l)
});
}
}
}
}), t;
}
function _T(r, e) {
for (var t = 0; t < r.length; t++) {
var n = e.seriesIndex != null && e.seriesIndex === r[t].seriesIndex || e.seriesId != null && e.seriesId === r[t].id;
if (n)
return t;
}
}
function cY(r, e, t, n) {
var a = [], i = [];
A(Pt(r.from), function(o) {
var s = _T(e.oldSeries, o);
s >= 0 && a.push({
dataGroupId: e.oldDataGroupIds[s],
data: e.oldData[s],
// TODO can specify divideShape in transition.
divide: Kn(e.oldData[s]),
groupIdDim: o.dimension
});
}), A(Pt(r.to), function(o) {
var s = _T(t.updatedSeries, o);
if (s >= 0) {
var l = t.updatedSeries[s].getData();
i.push({
dataGroupId: e.oldDataGroupIds[s],
data: l,
divide: Kn(l),
groupIdDim: o.dimension
});
}
}), a.length > 0 && i.length > 0 && cL(a, i, n);
}
function vY(r) {
r.registerUpdateLifecycle("series:beforeupdate", function(e, t, n) {
A(Pt(n.seriesTransition), function(a) {
A(Pt(a.to), function(i) {
for (var o = n.updatedSeries, s = 0; s < o.length; s++)
(i.seriesIndex != null && i.seriesIndex === o[s].seriesIndex || i.seriesId != null && i.seriesId === o[s].id) && (o[s][yh] = !0);
});
});
}), r.registerUpdateLifecycle("series:transition", function(e, t, n) {
var a = oY(t);
if (a.oldSeries && n.updatedSeries && n.optionChanged) {
var i = n.seriesTransition;
if (i)
A(Pt(i), function(v) {
cY(v, a, n, t);
});
else {
var o = fY(a, n);
A(o.keys(), function(v) {
var p = o.get(v);
cL(p.oldSeries, p.newSeries, t);
});
}
A(n.updatedSeries, function(v) {
v[yh] && (v[yh] = !1);
});
}
for (var s = e.getSeries(), l = a.oldSeries = [], u = a.oldDataGroupIds = [], h = a.oldData = [], f = 0; f < s.length; f++) {
var c = s[f].getData();
c.count() < fL && (l.push(s[f]), u.push(s[f].get("dataGroupId")), h.push(c));
}
});
}
gt([T5]);
gt([_5]);
gt([$5, i3, d3, X3, iG, UG, _F, r4, T4, L4, z4, kH, aW, dW, EW, NW, UW, QW, u6, d6, C6, s8]);
gt(D8);
gt(Q8);
gt(u2);
gt(f7);
gt(X2);
gt(d7);
gt(T7);
gt(f$);
gt(L$);
gt(tu);
gt(Z$);
gt(K$);
gt(o9);
gt(v9);
gt(_9);
gt(C9);
gt(N9);
gt(J9);
gt(QI);
gt(JI);
gt(_U);
gt(aL);
gt(iL);
gt(TU);
gt(VU);
gt(GU);
gt(vY);
gt(zz);
const pY = {
name: "ECharts",
props: {
option: {
type: Object,
default() {
return {
title: {
text: "ECharts 示例"
},
tooltip: {},
xAxis: {
data: ["衬衫", "羊毛衫", "雪纺衫", "裤子", "高跟鞋", "袜子"]
},
yAxis: {},
series: [{
name: "销量",
type: "bar",
data: [5, 20, 36, 10, 10, 20]
}]
};
}
}
},
data() {
return {
myChart: null
};
},
mounted() {
this.$refs.chartRef && (this.myChart = sB(this.$refs.chartRef), this.myChart.setOption(this.option));
},
beforeUnmount() {
this.myChart !== null && this.myChart !== void 0 && this.myChart.dispose();
},
watch: {
option: {
handler(r, e) {
this.myChart.setOption(r, !0);
},
deep: !0
}
},
methods: {}
}, dY = { class: "chart-container" }, gY = {
ref: "chartRef",
class: "chart"
};
function yY(r, e, t, n, a, i) {
return Ie(), Ye("div", dY, [
Kt("div", gY, null, 512)
]);
}
const mY = /* @__PURE__ */ Pl(pY, [["render", yY], ["__scopeId", "data-v-94c83b5e"]]), _Y = {
name: "LChatContent",
props: {
// 显示数据
dataSource: {
type: Array,
default() {
return [];
}
}
},
data() {
return {
// 根据内容控制滚动条在最底部
needScrollControl: !0,
marked: zt
};
},
components: {
ECharts: mY,
LznLoading: vE
},
mounted() {
this.$refs.lChatContent.addEventListener("scroll", this.handleScroll);
},
onUnmounted() {
this.$refs.lChatContent.removeEventListener("scroll", this.handleScroll);
},
watch: {
dataSource: {
handler(r, e) {
this.scrollControl();
},
deep: !0
}
},
methods: {
/**
* 滚动条监听
* @param {*} event
*/
handleScroll(r) {
const e = r.target;
e.scrollHeight - e.scrollTop >= e.clientHeight - 35 && e.scrollHeight - e.scrollTop <= e.clientHeight + 35 ? this.needScrollControl = !0 : this.needScrollControl = !1;
},
scrollControl() {
this.needScrollControl && (this.$refs.lChatContent.scrollTop = this.$refs.lChatContent.scrollHeight);
}
}
}, SY = {
class: "l-chat-content",
ref: "lChatContent"
}, xY = { class: "lContentSection" }, bY = {
key: 0,
class: "headImg",
style: { left: "0" }
}, wY = ["src"], TY = {
key: 0,
class: "response-status"
}, CY = {
key: 0,
class: "status-sign"
}, DY = {
key: 1,
class: "status-sign"
}, AY = ["innerHTML"], MY = { key: 1 }, IY = {
key: 1,
class: "echarts_loading"
}, LY = {
key: 1,
class: "headImg",
style: { right: "0" }
}, EY = ["src"];
function PY(r, e, t, n, a, i) {
const o = a0("LznLoading"), s = a0("ECharts");
return Ie(), Ye("div", SY, [
Kt("div", xY, [
(Ie(!0), Ye(mL, null, _L(t.dataSource, (l, u) => (Ie(), Ye("div", {
key: u,
class: i0([l.type === "myMsg" ? "my-msg-item" : "other-msg-item", "msg-item"])
}, [
l.type !== "myMsg" ? (Ie(), Ye("div", bY, [
Kt("img", {
src: l.avatar
}, null, 8, wY)
])) : Qo("", !0),
Kt("div", {
class: i0([l.type === "myMsg" ? "my-msg-content" : "other-msg-content", "msg-content"])
}, [
l.type === "ai" ? (Ie(), Ye("div", TY, [
l.contentLoading ? (Ie(), Ye("span", CY, [
o0(o, { txt: "正在响应..." })
])) : (Ie(), Ye("span", DY, "回答结束"))
])) : Qo("", !0),
Kt("div", {
innerHTML: a.marked(l.content)
}, null, 8, AY),
l.echartsType ? (Ie(), Ye("div", MY, [
l.echartsData ? (Ie(), SL(s, {
key: 0,
option: l.echartsData,
ref_for: !0,
ref: l.id
}, null, 8, ["option"])) : !l.echartsData && l.contentLoading ? (Ie(), Ye("div", IY, [
o0(o, { txt: "echarts图表加载中..." })
])) : Qo("", !0)
])) : Qo("", !0)
], 2),
l.type === "myMsg" ? (Ie(), Ye("div", LY, [
Kt("img", {
src: l.avatar
}, null, 8, EY)
])) : Qo("", !0)
], 2))), 128))
])
], 512);
}
const vL = /* @__PURE__ */ Pl(_Y, [["render", PY]]), kY = {
name: "LChatInput",
props: {
// 显示停止回答按钮
stopAnswerShow: {
type: Boolean,
default: !1
},
// 输入框内容
value: {
type: String,
default: ""
},
// 提示词数据
questionWordsData: {
type: Array,
default() {
return [];
}
}
},
data() {
return {
newMyMsg: ""
};
},
created() {
this.initData();
},
watch: {
newMyMsg: {
handler(r, e) {
r ? (this.$refs.textarea.style.backgroundColor = "white", this.$refs.entBtn.style.backgroundColor = "#0052d9", this.$refs.entBtn.style.color = "#fff", this.$refs.entBtn.style.cursor = "pointer") : (this.$refs.entBtn.style.backgroundColor = "transparent", this.$refs.entBtn.style.color = "#B6C8E7", this.$refs.entBtn.style.cursor = "not-allowed");
}
},
value: {
handler(r, e) {
this.newMyMsg = r;
}
}
},
methods: {
// 初始化数据
initData() {
this.newMyMsg = this.value;
},
// 提示词点击事件
questionWordsClick(r) {
this.$emit("questionWordsClick", r);
},
/**
* 键盘按下事件
*/
handleKeyDown(r) {
r.keyCode === 13 && (r.ctrlKey && r.keyCode === 13 ? (console.log("Ctrl+Enter被按下"), this.newMyMsg += `
`) : (r.preventDefault(), this.sendMessage()));
},
// 发送消息的方法
sendMessage() {
this.newMyMsg.trim() !== "" && (this.$emit("send", this.newMyMsg), this.newMyMsg = "", this.inputTextArea(), this.$nextTick(() => {
let r = document.getElementsByClassName("l-chat-content")[0];
r.scrollTop = r.scrollHeight;
}));
},
// 停止回答
stopAnswer() {
this.$emit("stopAnswer");
},
// 聚焦事件
focusTextArea() {
this.newMyMsg ? this.$refs.entBtn.style.color = "#fff" : this.$refs.entBtn.style.color = "#B6C8E7", this.$refs.textarea.style.backgroundColor = "white";
},
// 输入事件
inputTextArea() {
this.$emit("input", this.newMyMsg);
},
// 失去焦点事件
blurTextArea() {
this.newMyMsg ? (this.$refs.entBtn.style.color = "#B6C8E7", this.$refs.textarea.style.backgroundColor = "white") : (this.$refs.entBtn.style.color = "lightgray", this.$refs.textarea.style.backgroundColor = "#f3f3f3");
}
}
}, RY = { class: "ai_chat_input_area" }, NY = { class: "input_area_box" };
function OY(r, e, t, n, a, i) {
return Ie(), Ye("div", RY, [
s0(Kt("div", {
class: "stop_answer_box",
style: lo({ top: t.questionWordsData.length ? "-110%" : "-55%" })
}, [
Kt("span", {
class: "stop_btn",
onClick: e[0] || (e[0] = (...o) => i.stopAnswer && i.stopAnswer(...o))
}, e[7] || (e[7] = [
Kt("svg", {
width: "10",
height: "10",
viewBox: "0 0 20 20",
fill: "none",
xmlns: "http://www.w3.org/2000/svg",
class: "mr-[5px] h-3.5 w-3.5 text-gray-500",
"data-icon": "StopCircle",
"aria-hidden": "true"
}, [
Kt("g", { id: "stop-circle" }, [
Kt("path", {
id: "Solid",
"fill-rule": "evenodd",
"clip-rule": "evenodd",
d: "M9.99992 0.833984C4.93731 0.833984 0.833252 4.93804 0.833252 10.0007C0.833252 15.0633 4.93731 19.1673 9.99992 19.1673C15.0625 19.1673 19.1666 15.0633 19.1666 10.0007C19.1666 4.93804 15.0625 0.833984 9.99992 0.833984ZM6.75741 7.12232C6.66658 7.30058 6.66658 7.53394 6.66658 8.00065V12.0006C6.66658 12.4674 6.66658 12.7007 6.75741 12.879C6.83731 13.0358 6.96479 13.1633 7.12159 13.2432C7.29985 13.334 7.53321 13.334 7.99992 13.334H11.9999C12.4666 13.334 12.7 13.334 12.8782 13.2432C13.035 13.1633 13.1625 13.0358 13.2424 12.879C13.3333 12.7007 13.3333 12.4674 13.3333 12.0006V8.00065C13.3333 7.53394 13.3333 7.30058 13.2424 7.12232C13.1625 6.96552 13.035 6.83804 12.8782 6.75814C12.7 6.66732 12.4666 6.66732 11.9999 6.66732H7.99992C7.53321 6.66732 7.29985 6.66732 7.12159 6.75814C6.96479 6.83804 6.83731 6.96552 6.75741 7.12232Z",
fill: "currentColor"
})
])
], -1),
xL(" 停止回答 ")
]))
], 4), [
[bL, t.stopAnswerShow]
]),
Kt("div", NY, [
s0(Kt("textarea", {
class: "input_area_inner",
ref: "textarea",
placeholder: "请输入关键词查询,Ctrl+Enter换行",
"onUpdate:modelValue": e[1] || (e[1] = (o) => a.newMyMsg = o),
style: { "min-height": "63.6px", height: "63.6px" },
onFocus: e[2] || (e[2] = (...o) => i.focusTextArea && i.focusTextArea(...o)),
onBlur: e[3] || (e[3] = (...o) => i.blurTextArea && i.blurTextArea(...o)),
onInput: e[4] || (e[4] = (...o) => i.inputTextArea && i.inputTextArea(...o)),
onKeydown: e[5] || (e[5] = (...o) => i.handleKeyDown && i.handleKeyDown(...o))
}, null, 544), [
[wL, a.newMyMsg]
]),
Kt("button", {
class: "enter-btn",
type: "button",
ref: "entBtn",
onClick: e[6] || (e[6] = (...o) => i.sendMessage && i.sendMessage(...o))
}, e[8] || (e[8] = [
Kt("span", {
role: "img",
"aria-label": "rocket"
}, [
Kt("svg", {
focusable: "false",
"data-icon": "rocket",
width: "1em",
height: "1em",
fill: "currentColor",
"aria-hidden": "true",
viewBox: "64 64 896 896"
}, [
Kt("path", { d: "M864 736c0-111.6-65.4-208-160-252.9V317.3c0-15.1-5.3-29.7-15.1-41.2L536.5 95.4C530.1 87.8 521 84 512 84s-18.1 3.8-24.5 11.4L335.1 276.1a63.97 63.97 0 00-15.1 41.2v165.8C225.4 528 160 624.4 160 736h156.5c-2.3 7.2-3.5 15-3.5 23.8 0 22.1 7.6 43.7 21.4 60.8a97.2 97.2 0 0043.1 30.6c23.1 54 75.6 88.8 134.5 88.8 29.1 0 57.3-8.6 81.4-24.8 23.6-15.8 41.9-37.9 53-64a97 97 0 0043.1-30.5 97.52 97.52 0 0021.4-60.8c0-8.4-1.1-16.4-3.1-23.8H864zM762.3 621.4c9.4 14.6 17 30.3 22.5 46.6H700V558.7a211.6 211.6 0 0162.3 62.7zM388 483.1V318.8l124-147 124 147V668H388V483.1zM239.2 668c5.5-16.3 13.1-32 22.5-46.6 16.3-25.2 37.5-46.5 62.3-62.7V668h-84.8zm388.9 116.2c-5.2 3-11.2 4.2-17.1 3.4l-19.5-2.4-2.8 19.4c-5.4 37.9-38.4 66.5-76.7 66.5-38.3 0-71.3-28.6-76.7-66.5l-2.8-19.5-19.5 2.5a27.7 27.7 0 01-17.1-3.5c-8.7-5-14.1-14.3-14.1-24.4 0-10.6 5.9-19.4 14.6-23.8h231.3c8.8 4.5 14.6 13.3 14.6 23.8-.1 10.2-5.5 19.6-14.2 24.5zM464 400a48 48 0 1096 0 48 48 0 10-96 0z" })
])
], -1)
]), 512)
])
]);
}
const pL = /* @__PURE__ */ Pl(kY, [["render", OY]]), VY = [
ST,
vL,
pL
], Af = function(r) {
Af.installed || (Af.installed = !0, VY.forEach((e) => r.component(e.name, e)));
};
typeof window < "u" && window.Vue && Af(window.Vue);
const GY = {
install: Af,
LAIChatComponent: ST,
LChatContent: vL,
LChatInput: pL
};
export {
ST as LAIChatComponent,
vL as LChatContent,
pL as LChatInput,
GY as default
};