You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by su...@apache.org on 2020/10/27 19:16:28 UTC
[incubator-echarts] 05/05: Merge branch 'next' of
github.com:apache/incubator-echarts into next
This is an automated email from the ASF dual-hosted git repository.
sushuang pushed a commit to branch next
in repository https://gitbox.apache.org/repos/asf/incubator-echarts.git
commit a0fd0b7aa341be4ea8e2ddea1bf2dfc0ab48326a
Merge: ec5bcf4 3e7bdc3
Author: 100pah <su...@gmail.com>
AuthorDate: Wed Oct 28 03:13:20 2020 +0800
Merge branch 'next' of github.com:apache/incubator-echarts into next
# Conflicts:
# package-lock.json
dist/echarts.common.js | 14373 ++--
dist/echarts.common.js.map | 2 +-
dist/echarts.common.min.js | 2 +-
dist/echarts.js | 139678 +++++++++++++++------------------
dist/echarts.js.map | 2 +-
dist/echarts.min.js | 2 +-
dist/echarts.simple.js | 12479 +--
dist/echarts.simple.js.map | 2 +-
dist/echarts.simple.min.js | 2 +-
i18n/langJA-obj.js | 173 +
i18n/langJA.js | 169 +
package.json | 4 +-
src/chart/sunburst/SunburstPiece.ts | 10 +-
src/echarts.ts | 4 +-
14 files changed, 79909 insertions(+), 86993 deletions(-)
diff --cc dist/echarts.js
index 7ef593f,0b9ef45..75c2d21
--- a/dist/echarts.js
+++ b/dist/echarts.js
@@@ -1,77512 -1,80147 +1,67036 @@@
--(function (global, factory) {
-- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'], factory) : (global = global || self, factory(global.echarts = {}));
--})(this, function (exports) {
-- 'use strict';
-- /*! *****************************************************************************
-- Copyright (c) Microsoft Corporation. All rights reserved.
-- Licensed under the Apache License, Version 2.0 (the "License"); you may not use
-- this file except in compliance with the License. You may obtain a copy of the
-- License at http://www.apache.org/licenses/LICENSE-2.0
-- THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-- KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
-- WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
-- MERCHANTABLITY OR NON-INFRINGEMENT.
-- See the Apache Version 2.0 License for specific language governing permissions
-- and limitations under the License.
-- ***************************************************************************** */
--
-- /* global Reflect, Promise */
--
-- var extendStatics = function (d, b) {
-- extendStatics = Object.setPrototypeOf || {
-- __proto__: []
-- } instanceof Array && function (d, b) {
-- d.__proto__ = b;
-- } || function (d, b) {
-- for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
-- };
--
-- return extendStatics(d, b);
-- };
--
-- function __extends(d, b) {
-- extendStatics(d, b);
-- function __() {
-- this.constructor = d;
-- }
--
-- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
++// ------------- WRAPPED UMD --------------- //
++(function (root, factory) {
++ if (typeof define === 'function' && define.amd) {
++ // AMD. Register as an anonymous module.
++ define(['exports'], factory);
++ } else if (typeof exports === 'object' && typeof exports.nodeName !== 'string') {
++ // CommonJS
++ factory(exports);
++ } else {
++ // Browser globals
++ factory((root.echarts = {}));
++ }
++}(typeof self !== 'undefined' ? self : this, function (exports, b) {
++let __defineProperty = Object.defineProperty;
++let __markAsModule = (target) => {
++ return __defineProperty(target, "__esModule", {value: true});
++};
++let __export = (target, all) => {
++ __markAsModule(target);
++ for (let name2 in all)
++ __defineProperty(target, name2, {get: all[name2], enumerable: true});
++};
++
++// node_modules/zrender/src/core/env.ts
++class Browser {
++ constructor() {
++ this.firefox = false;
++ this.ie = false;
++ this.edge = false;
++ this.weChat = false;
++ }
++}
++class Env {
++ constructor() {
++ this.browser = new Browser();
++ this.node = false;
++ this.wxa = false;
++ this.worker = false;
++ this.canvasSupported = false;
++ this.svgSupported = false;
++ this.touchEventsSupported = false;
++ this.pointerEventsSupported = false;
++ this.domSupported = false;
++ }
++}
++const env5 = new Env();
++if (typeof wx === "object" && typeof wx.getSystemInfoSync === "function") {
++ env5.wxa = true;
++ env5.canvasSupported = true;
++ env5.touchEventsSupported = true;
++} else if (typeof document === "undefined" && typeof self !== "undefined") {
++ env5.worker = true;
++ env5.canvasSupported = true;
++} else if (typeof navigator === "undefined") {
++ env5.node = true;
++ env5.canvasSupported = true;
++ env5.svgSupported = true;
++} else {
++ detect(navigator.userAgent, env5);
++}
++function detect(ua, env22) {
++ const browser = env22.browser;
++ const firefox = ua.match(/Firefox\/([\d.]+)/);
++ const ie = ua.match(/MSIE\s([\d.]+)/) || ua.match(/Trident\/.+?rv:(([\d.]+))/);
++ const edge = ua.match(/Edge\/([\d.]+)/);
++ const weChat = /micromessenger/i.test(ua);
++ if (firefox) {
++ browser.firefox = true;
++ browser.version = firefox[1];
++ }
++ if (ie) {
++ browser.ie = true;
++ browser.version = ie[1];
++ }
++ if (edge) {
++ browser.edge = true;
++ browser.version = edge[1];
++ }
++ if (weChat) {
++ browser.weChat = true;
++ }
++ env22.canvasSupported = !!document.createElement("canvas").getContext;
++ env22.svgSupported = typeof SVGRect !== "undefined";
++ env22.touchEventsSupported = "ontouchstart" in window && !browser.ie && !browser.edge;
++ env22.pointerEventsSupported = "onpointerdown" in window && (browser.edge || browser.ie && +browser.version >= 11);
++ env22.domSupported = typeof document !== "undefined";
++}
++const env_default = env5;
++
++// node_modules/zrender/src/core/util.ts
++const util_exports2 = {};
++__export(util_exports2, {
++ $override: () => $override2,
++ HashMap: () => HashMap,
++ assert: () => assert,
++ bind: () => bind,
++ clone: () => clone2,
++ concatArray: () => concatArray,
++ createCanvas: () => createCanvas,
++ createHashMap: () => createHashMap,
++ createObject: () => createObject,
++ curry: () => curry,
++ defaults: () => defaults,
++ each: () => each,
++ eqNaN: () => eqNaN,
++ extend: () => extend,
++ filter: () => filter,
++ find: () => find,
++ guid: () => guid,
++ hasOwn: () => hasOwn,
++ indexOf: () => indexOf,
++ inherits: () => inherits,
++ isArray: () => isArray,
++ isArrayLike: () => isArrayLike,
++ isBuiltInObject: () => isBuiltInObject,
++ isDom: () => isDom,
++ isFunction: () => isFunction,
++ isGradientObject: () => isGradientObject,
++ isNumber: () => isNumber,
++ isObject: () => isObject,
++ isPatternObject: () => isPatternObject,
++ isPrimitive: () => isPrimitive,
++ isRegExp: () => isRegExp,
++ isString: () => isString,
++ isStringSafe: () => isStringSafe,
++ isTypedArray: () => isTypedArray,
++ keys: () => keys,
++ logError: () => logError,
++ map: () => map,
++ merge: () => merge,
++ mergeAll: () => mergeAll,
++ mixin: () => mixin,
++ noop: () => noop,
++ normalizeCssArray: () => normalizeCssArray,
++ reduce: () => reduce,
++ retrieve: () => retrieve,
++ retrieve2: () => retrieve2,
++ retrieve3: () => retrieve3,
++ setAsPrimitive: () => setAsPrimitive,
++ slice: () => slice,
++ trim: () => trim
++});
++const BUILTIN_OBJECT = {
++ "[object Function]": true,
++ "[object RegExp]": true,
++ "[object Date]": true,
++ "[object Error]": true,
++ "[object CanvasGradient]": true,
++ "[object CanvasPattern]": true,
++ "[object Image]": true,
++ "[object Canvas]": true
++};
++const TYPED_ARRAY = {
++ "[object Int8Array]": true,
++ "[object Uint8Array]": true,
++ "[object Uint8ClampedArray]": true,
++ "[object Int16Array]": true,
++ "[object Uint16Array]": true,
++ "[object Int32Array]": true,
++ "[object Uint32Array]": true,
++ "[object Float32Array]": true,
++ "[object Float64Array]": true
++};
++const objToString = Object.prototype.toString;
++const arrayProto = Array.prototype;
++const nativeForEach = arrayProto.forEach;
++const nativeFilter = arrayProto.filter;
++const nativeSlice = arrayProto.slice;
++const nativeMap = arrayProto.map;
++const ctorFunction = function() {
++}.constructor;
++const protoFunction = ctorFunction ? ctorFunction.prototype : null;
++const methods2 = {};
++function $override2(name2, fn) {
++ methods2[name2] = fn;
++}
++let idStart = 2311;
++function guid() {
++ return idStart++;
++}
++function logError(...args) {
++ if (typeof console !== "undefined") {
++ console.error.apply(args);
++ }
++}
++function clone2(source) {
++ if (source == null || typeof source !== "object") {
++ return source;
}
--
-- var __assign = function () {
-- __assign = Object.assign || function __assign(t) {
-- for (var s, i = 1, n = arguments.length; i < n; i++) {
-- s = arguments[i];
--
-- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
++ let result = source;
++ const typeStr = objToString.call(source);
++ if (typeStr === "[object Array]") {
++ if (!isPrimitive(source)) {
++ result = [];
++ for (let i = 0, len2 = source.length; i < len2; i++) {
++ result[i] = clone2(source[i]);
}
--
-- return t;
-- };
--
-- return __assign.apply(this, arguments);
-- };
--
-- function __spreadArrays() {
-- for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
--
-- for (var r = Array(s), k = 0, i = 0; i < il; i++) for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) r[k] = a[j];
--
-- return r;
-- }
--
-- var Browser = function () {
-- function Browser() {
-- this.firefox = false;
-- this.ie = false;
-- this.edge = false;
-- this.weChat = false;
-- }
--
-- return Browser;
-- }();
--
-- var Env = function () {
-- function Env() {
-- this.browser = new Browser();
-- this.node = false;
-- this.wxa = false;
-- this.worker = false;
-- this.canvasSupported = false;
-- this.svgSupported = false;
-- this.touchEventsSupported = false;
-- this.pointerEventsSupported = false;
-- this.domSupported = false;
-- }
--
-- return Env;
-- }();
--
-- var env = new Env();
--
-- if (typeof wx === 'object' && typeof wx.getSystemInfoSync === 'function') {
-- env.wxa = true;
-- env.canvasSupported = true;
-- env.touchEventsSupported = true;
-- } else if (typeof document === 'undefined' && typeof self !== 'undefined') {
-- env.worker = true;
-- env.canvasSupported = true;
-- } else if (typeof navigator === 'undefined') {
-- env.node = true;
-- env.canvasSupported = true;
-- env.svgSupported = true;
-- } else {
-- detect(navigator.userAgent, env);
-- }
--
-- function detect(ua, env) {
-- var browser = env.browser;
-- var firefox = ua.match(/Firefox\/([\d.]+)/);
-- var ie = ua.match(/MSIE\s([\d.]+)/) || ua.match(/Trident\/.+?rv:(([\d.]+))/);
-- var edge = ua.match(/Edge\/([\d.]+)/);
-- var weChat = /micromessenger/i.test(ua);
--
-- if (firefox) {
-- browser.firefox = true;
-- browser.version = firefox[1];
-- }
--
-- if (ie) {
-- browser.ie = true;
-- browser.version = ie[1];
}
--
-- if (edge) {
-- browser.edge = true;
-- browser.version = edge[1];
++ } else if (TYPED_ARRAY[typeStr]) {
++ if (!isPrimitive(source)) {
++ const Ctor = source.constructor;
++ if (Ctor.from) {
++ result = Ctor.from(source);
++ } else {
++ result = new Ctor(source.length);
++ for (let i = 0, len2 = source.length; i < len2; i++) {
++ result[i] = clone2(source[i]);
++ }
++ }
}
--
-- if (weChat) {
-- browser.weChat = true;
++ } else if (!BUILTIN_OBJECT[typeStr] && !isPrimitive(source) && !isDom(source)) {
++ result = {};
++ for (let key in source) {
++ if (source.hasOwnProperty(key)) {
++ result[key] = clone2(source[key]);
++ }
}
--
-- env.canvasSupported = !!document.createElement('canvas').getContext;
-- env.svgSupported = typeof SVGRect !== 'undefined';
-- env.touchEventsSupported = 'ontouchstart' in window && !browser.ie && !browser.edge;
-- env.pointerEventsSupported = 'onpointerdown' in window && (browser.edge || browser.ie && +browser.version >= 11);
-- env.domSupported = typeof document !== 'undefined';
-- }
--
-- var BUILTIN_OBJECT = {
-- '[object Function]': true,
-- '[object RegExp]': true,
-- '[object Date]': true,
-- '[object Error]': true,
-- '[object CanvasGradient]': true,
-- '[object CanvasPattern]': true,
-- '[object Image]': true,
-- '[object Canvas]': true
-- };
-- var TYPED_ARRAY = {
-- '[object Int8Array]': true,
-- '[object Uint8Array]': true,
-- '[object Uint8ClampedArray]': true,
-- '[object Int16Array]': true,
-- '[object Uint16Array]': true,
-- '[object Int32Array]': true,
-- '[object Uint32Array]': true,
-- '[object Float32Array]': true,
-- '[object Float64Array]': true
-- };
-- var objToString = Object.prototype.toString;
-- var arrayProto = Array.prototype;
-- var nativeForEach = arrayProto.forEach;
-- var nativeFilter = arrayProto.filter;
-- var nativeSlice = arrayProto.slice;
-- var nativeMap = arrayProto.map;
--
-- var ctorFunction = function () {}.constructor;
--
-- var protoFunction = ctorFunction ? ctorFunction.prototype : null;
-- var methods = {};
--
-- function $override(name, fn) {
-- methods[name] = fn;
}
--
-- var idStart = 0x0907;
--
-- function guid() {
-- return idStart++;
++ return result;
++}
++function merge(target, source, overwrite) {
++ if (!isObject(source) || !isObject(target)) {
++ return overwrite ? clone2(source) : target;
}
--
-- function logError() {
-- var args = [];
--
-- for (var _i = 0; _i < arguments.length; _i++) {
-- args[_i] = arguments[_i];
++ for (let key in source) {
++ if (source.hasOwnProperty(key)) {
++ const targetProp = target[key];
++ const sourceProp = source[key];
++ if (isObject(sourceProp) && isObject(targetProp) && !isArray(sourceProp) && !isArray(targetProp) && !isDom(sourceProp) && !isDom(targetProp) && !isBuiltInObject(sourceProp) && !isBuiltInObject(targetProp) && !isPrimitive(sourceProp) && !isPrimitive(targetProp)) {
++ merge(targetProp, sourceProp, overwrite);
++ } else if (overwrite || !(key in target)) {
++ target[key] = clone2(source[key]);
++ }
}
--
-- if (typeof console !== 'undefined') {
-- console.error.apply(args);
++ }
++ return target;
++}
++function mergeAll(targetAndSources, overwrite) {
++ let result = targetAndSources[0];
++ for (let i = 1, len2 = targetAndSources.length; i < len2; i++) {
++ result = merge(result, targetAndSources[i], overwrite);
++ }
++ return result;
++}
++function extend(target, source) {
++ if (Object.assign) {
++ Object.assign(target, source);
++ } else {
++ for (let key in source) {
++ if (source.hasOwnProperty(key)) {
++ target[key] = source[key];
++ }
}
}
--
-- function clone(source) {
-- if (source == null || typeof source !== 'object') {
-- return source;
++ return target;
++}
++function defaults(target, source, overlay) {
++ const keysArr = keys(source);
++ for (let i = 0; i < keysArr.length; i++) {
++ let key = keysArr[i];
++ if (overlay ? source[key] != null : target[key] == null) {
++ target[key] = source[key];
}
--
-- var result = source;
-- var typeStr = objToString.call(source);
--
-- if (typeStr === '[object Array]') {
-- if (!isPrimitive(source)) {
-- result = [];
--
-- for (var i = 0, len = source.length; i < len; i++) {
-- result[i] = clone(source[i]);
-- }
-- }
-- } else if (TYPED_ARRAY[typeStr]) {
-- if (!isPrimitive(source)) {
-- var Ctor = source.constructor;
--
-- if (Ctor.from) {
-- result = Ctor.from(source);
-- } else {
-- result = new Ctor(source.length);
--
-- for (var i = 0, len = source.length; i < len; i++) {
-- result[i] = clone(source[i]);
-- }
-- }
++ }
++ return target;
++}
++const createCanvas = function() {
++ return methods2.createCanvas();
++};
++methods2.createCanvas = function() {
++ return document.createElement("canvas");
++};
++function indexOf(array, value) {
++ if (array) {
++ if (array.indexOf) {
++ return array.indexOf(value);
++ }
++ for (let i = 0, len2 = array.length; i < len2; i++) {
++ if (array[i] === value) {
++ return i;
}
-- } else if (!BUILTIN_OBJECT[typeStr] && !isPrimitive(source) && !isDom(source)) {
-- result = {};
--
-- for (var key in source) {
-- if (source.hasOwnProperty(key)) {
-- result[key] = clone(source[key]);
++ }
++ }
++ return -1;
++}
++function inherits(clazz7, baseClazz) {
++ const clazzPrototype = clazz7.prototype;
++ function F() {
++ }
++ F.prototype = baseClazz.prototype;
++ clazz7.prototype = new F();
++ for (let prop in clazzPrototype) {
++ if (clazzPrototype.hasOwnProperty(prop)) {
++ clazz7.prototype[prop] = clazzPrototype[prop];
++ }
++ }
++ clazz7.prototype.constructor = clazz7;
++ clazz7.superClass = baseClazz;
++}
++function mixin(target, source, override) {
++ target = "prototype" in target ? target.prototype : target;
++ source = "prototype" in source ? source.prototype : source;
++ if (Object.getOwnPropertyNames) {
++ const keyList = Object.getOwnPropertyNames(source);
++ for (let i = 0; i < keyList.length; i++) {
++ const key = keyList[i];
++ if (key !== "constructor") {
++ if (override ? source[key] != null : target[key] == null) {
++ target[key] = source[key];
}
}
}
--
-- return result;
++ } else {
++ defaults(target, source, override);
}
--
-- function merge(target, source, overwrite) {
-- if (!isObject(source) || !isObject(target)) {
-- return overwrite ? clone(source) : target;
++}
++function isArrayLike(data) {
++ if (!data) {
++ return false;
++ }
++ if (typeof data === "string") {
++ return false;
++ }
++ return typeof data.length === "number";
++}
++function each(arr, cb, context) {
++ if (!(arr && cb)) {
++ return;
++ }
++ if (arr.forEach && arr.forEach === nativeForEach) {
++ arr.forEach(cb, context);
++ } else if (arr.length === +arr.length) {
++ for (let i = 0, len2 = arr.length; i < len2; i++) {
++ cb.call(context, arr[i], i, arr);
}
--
-- for (var key in source) {
-- if (source.hasOwnProperty(key)) {
-- var targetProp = target[key];
-- var sourceProp = source[key];
--
-- if (isObject(sourceProp) && isObject(targetProp) && !isArray(sourceProp) && !isArray(targetProp) && !isDom(sourceProp) && !isDom(targetProp) && !isBuiltInObject(sourceProp) && !isBuiltInObject(targetProp) && !isPrimitive(sourceProp) && !isPrimitive(targetProp)) {
-- merge(targetProp, sourceProp, overwrite);
-- } else if (overwrite || !(key in target)) {
-- target[key] = clone(source[key]);
-- }
++ } else {
++ for (let key in arr) {
++ if (arr.hasOwnProperty(key)) {
++ cb.call(context, arr[key], key, arr);
}
}
--
-- return target;
}
--
-- function mergeAll(targetAndSources, overwrite) {
-- var result = targetAndSources[0];
--
-- for (var i = 1, len = targetAndSources.length; i < len; i++) {
-- result = merge(result, targetAndSources[i], overwrite);
++}
++function map(arr, cb, context) {
++ if (!arr) {
++ return [];
++ }
++ if (!cb) {
++ return slice(arr);
++ }
++ if (arr.map && arr.map === nativeMap) {
++ return arr.map(cb, context);
++ } else {
++ const result = [];
++ for (let i = 0, len2 = arr.length; i < len2; i++) {
++ result.push(cb.call(context, arr[i], i, arr));
}
--
return result;
}
--
-- function extend(target, source) {
-- if (Object.assign) {
-- Object.assign(target, source);
-- } else {
-- for (var key in source) {
-- if (source.hasOwnProperty(key)) {
-- target[key] = source[key];
-- }
++}
++function reduce(arr, cb, memo, context) {
++ if (!(arr && cb)) {
++ return;
++ }
++ for (let i = 0, len2 = arr.length; i < len2; i++) {
++ memo = cb.call(context, memo, arr[i], i, arr);
++ }
++ return memo;
++}
++function filter(arr, cb, context) {
++ if (!arr) {
++ return [];
++ }
++ if (!cb) {
++ return slice(arr);
++ }
++ if (arr.filter && arr.filter === nativeFilter) {
++ return arr.filter(cb, context);
++ } else {
++ const result = [];
++ for (let i = 0, len2 = arr.length; i < len2; i++) {
++ if (cb.call(context, arr[i], i, arr)) {
++ result.push(arr[i]);
}
}
--
-- return target;
++ return result;
}
--
-- function defaults(target, source, overlay) {
-- var keysArr = keys(source);
--
-- for (var i = 0; i < keysArr.length; i++) {
-- var key = keysArr[i];
--
-- if (overlay ? source[key] != null : target[key] == null) {
-- target[key] = source[key];
-- }
++}
++function find(arr, cb, context) {
++ if (!(arr && cb)) {
++ return;
++ }
++ for (let i = 0, len2 = arr.length; i < len2; i++) {
++ if (cb.call(context, arr[i], i, arr)) {
++ return arr[i];
}
--
-- return target;
}
--
-- var createCanvas = function () {
-- return methods.createCanvas();
++}
++function keys(obj) {
++ if (!obj) {
++ return [];
++ }
++ if (Object.keys) {
++ return Object.keys(obj);
++ }
++ let keyList = [];
++ for (let key in obj) {
++ if (obj.hasOwnProperty(key)) {
++ keyList.push(key);
++ }
++ }
++ return keyList;
++}
++function bindPolyfill(func, context, ...args) {
++ return function() {
++ return func.apply(context, args.concat(nativeSlice.call(arguments)));
};
--
-- methods.createCanvas = function () {
-- return document.createElement('canvas');
++}
++const bind = protoFunction && isFunction(protoFunction.bind) ? protoFunction.call.bind(protoFunction.bind) : bindPolyfill;
++function curry(func, ...args) {
++ return function() {
++ return func.apply(this, args.concat(nativeSlice.call(arguments)));
};
--
-- function indexOf(array, value) {
-- if (array) {
-- if (array.indexOf) {
-- return array.indexOf(value);
-- }
--
-- for (var i = 0, len = array.length; i < len; i++) {
-- if (array[i] === value) {
-- return i;
++}
++function isArray(value) {
++ if (Array.isArray) {
++ return Array.isArray(value);
++ }
++ return objToString.call(value) === "[object Array]";
++}
++function isFunction(value) {
++ return typeof value === "function";
++}
++function isString(value) {
++ return typeof value === "string";
++}
++function isStringSafe(value) {
++ return objToString.call(value) === "[object String]";
++}
++function isNumber(value) {
++ return typeof value === "number";
++}
++function isObject(value) {
++ const type = typeof value;
++ return type === "function" || !!value && type === "object";
++}
++function isBuiltInObject(value) {
++ return !!BUILTIN_OBJECT[objToString.call(value)];
++}
++function isTypedArray(value) {
++ return !!TYPED_ARRAY[objToString.call(value)];
++}
++function isDom(value) {
++ return typeof value === "object" && typeof value.nodeType === "number" && typeof value.ownerDocument === "object";
++}
++function isGradientObject(value) {
++ return value.colorStops != null;
++}
++function isPatternObject(value) {
++ return value.image != null;
++}
++function isRegExp(value) {
++ return objToString.call(value) === "[object RegExp]";
++}
++function eqNaN(value) {
++ return value !== value;
++}
++function retrieve(...args) {
++ for (let i = 0, len2 = args.length; i < len2; i++) {
++ if (args[i] != null) {
++ return args[i];
++ }
++ }
++}
++function retrieve2(value0, value1) {
++ return value0 != null ? value0 : value1;
++}
++function retrieve3(value0, value1, value2) {
++ return value0 != null ? value0 : value1 != null ? value1 : value2;
++}
++function slice(arr, ...args) {
++ return nativeSlice.apply(arr, args);
++}
++function normalizeCssArray(val) {
++ if (typeof val === "number") {
++ return [val, val, val, val];
++ }
++ const len2 = val.length;
++ if (len2 === 2) {
++ return [val[0], val[1], val[0], val[1]];
++ } else if (len2 === 3) {
++ return [val[0], val[1], val[2], val[1]];
++ }
++ return val;
++}
++function assert(condition, message) {
++ if (!condition) {
++ throw new Error(message);
++ }
++}
++function trim(str) {
++ if (str == null) {
++ return null;
++ } else if (typeof str.trim === "function") {
++ return str.trim();
++ } else {
++ return str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
++ }
++}
++const primitiveKey = "__ec_primitive__";
++function setAsPrimitive(obj) {
++ obj[primitiveKey] = true;
++}
++function isPrimitive(obj) {
++ return obj[primitiveKey];
++}
++class HashMap {
++ constructor(obj) {
++ this.data = {};
++ const isArr = isArray(obj);
++ this.data = {};
++ const thisMap = this;
++ obj instanceof HashMap ? obj.each(visit) : obj && each(obj, visit);
++ function visit(value, key) {
++ isArr ? thisMap.set(value, key) : thisMap.set(key, value);
++ }
++ }
++ get(key) {
++ return this.data.hasOwnProperty(key) ? this.data[key] : null;
++ }
++ set(key, value) {
++ return this.data[key] = value;
++ }
++ each(cb, context) {
++ for (let key in this.data) {
++ if (this.data.hasOwnProperty(key)) {
++ cb.call(context, this.data[key], key);
++ }
++ }
++ }
++ keys() {
++ return keys(this.data);
++ }
++ removeKey(key) {
++ delete this.data[key];
++ }
++}
++function createHashMap(obj) {
++ return new HashMap(obj);
++}
++function concatArray(a, b) {
++ const newArray = new a.constructor(a.length + b.length);
++ for (let i = 0; i < a.length; i++) {
++ newArray[i] = a[i];
++ }
++ const offset = a.length;
++ for (let i = 0; i < b.length; i++) {
++ newArray[i + offset] = b[i];
++ }
++ return newArray;
++}
++function createObject(proto2, properties) {
++ let obj;
++ if (Object.create) {
++ obj = Object.create(proto2);
++ } else {
++ const StyleCtor = function() {
++ };
++ StyleCtor.prototype = proto2;
++ obj = new StyleCtor();
++ }
++ if (properties) {
++ extend(obj, properties);
++ }
++ return obj;
++}
++function hasOwn(own, prop) {
++ return own.hasOwnProperty(prop);
++}
++function noop() {
++}
++
++// node_modules/zrender/src/core/vector.ts
++const vector_exports = {};
++__export(vector_exports, {
++ add: () => add,
++ applyTransform: () => applyTransform,
++ clone: () => clone3,
++ copy: () => copy2,
++ create: () => create2,
++ dist: () => dist,
++ distSquare: () => distSquare,
++ distance: () => distance,
++ distanceSquare: () => distanceSquare,
++ div: () => div,
++ dot: () => dot,
++ len: () => len,
++ lenSquare: () => lenSquare,
++ length: () => length,
++ lengthSquare: () => lengthSquare,
++ lerp: () => lerp,
++ max: () => max3,
++ min: () => min3,
++ mul: () => mul2,
++ negate: () => negate,
++ normalize: () => normalize,
++ scale: () => scale2,
++ scaleAndAdd: () => scaleAndAdd,
++ set: () => set,
++ sub: () => sub
++});
++function create2(x, y) {
++ if (x == null) {
++ x = 0;
++ }
++ if (y == null) {
++ y = 0;
++ }
++ return [x, y];
++}
++function copy2(out2, v) {
++ out2[0] = v[0];
++ out2[1] = v[1];
++ return out2;
++}
++function clone3(v) {
++ return [v[0], v[1]];
++}
++function set(out2, a, b) {
++ out2[0] = a;
++ out2[1] = b;
++ return out2;
++}
++function add(out2, v12, v22) {
++ out2[0] = v12[0] + v22[0];
++ out2[1] = v12[1] + v22[1];
++ return out2;
++}
++function scaleAndAdd(out2, v12, v22, a) {
++ out2[0] = v12[0] + v22[0] * a;
++ out2[1] = v12[1] + v22[1] * a;
++ return out2;
++}
++function sub(out2, v12, v22) {
++ out2[0] = v12[0] - v22[0];
++ out2[1] = v12[1] - v22[1];
++ return out2;
++}
++function len(v) {
++ return Math.sqrt(lenSquare(v));
++}
++const length = len;
++function lenSquare(v) {
++ return v[0] * v[0] + v[1] * v[1];
++}
++const lengthSquare = lenSquare;
++function mul2(out2, v12, v22) {
++ out2[0] = v12[0] * v22[0];
++ out2[1] = v12[1] * v22[1];
++ return out2;
++}
++function div(out2, v12, v22) {
++ out2[0] = v12[0] / v22[0];
++ out2[1] = v12[1] / v22[1];
++ return out2;
++}
++function dot(v12, v22) {
++ return v12[0] * v22[0] + v12[1] * v22[1];
++}
++function scale2(out2, v, s) {
++ out2[0] = v[0] * s;
++ out2[1] = v[1] * s;
++ return out2;
++}
++function normalize(out2, v) {
++ const d = len(v);
++ if (d === 0) {
++ out2[0] = 0;
++ out2[1] = 0;
++ } else {
++ out2[0] = v[0] / d;
++ out2[1] = v[1] / d;
++ }
++ return out2;
++}
++function distance(v12, v22) {
++ return Math.sqrt((v12[0] - v22[0]) * (v12[0] - v22[0]) + (v12[1] - v22[1]) * (v12[1] - v22[1]));
++}
++const dist = distance;
++function distanceSquare(v12, v22) {
++ return (v12[0] - v22[0]) * (v12[0] - v22[0]) + (v12[1] - v22[1]) * (v12[1] - v22[1]);
++}
++const distSquare = distanceSquare;
++function negate(out2, v) {
++ out2[0] = -v[0];
++ out2[1] = -v[1];
++ return out2;
++}
++function lerp(out2, v12, v22, t) {
++ out2[0] = v12[0] + t * (v22[0] - v12[0]);
++ out2[1] = v12[1] + t * (v22[1] - v12[1]);
++ return out2;
++}
++function applyTransform(out2, v, m2) {
++ const x = v[0];
++ const y = v[1];
++ out2[0] = m2[0] * x + m2[2] * y + m2[4];
++ out2[1] = m2[1] * x + m2[3] * y + m2[5];
++ return out2;
++}
++function min3(out2, v12, v22) {
++ out2[0] = Math.min(v12[0], v22[0]);
++ out2[1] = Math.min(v12[1], v22[1]);
++ return out2;
++}
++function max3(out2, v12, v22) {
++ out2[0] = Math.max(v12[0], v22[0]);
++ out2[1] = Math.max(v12[1], v22[1]);
++ return out2;
++}
++
++// node_modules/zrender/src/mixin/Draggable.ts
++class Param {
++ constructor(target, e2) {
++ this.target = target;
++ this.topTarget = e2 && e2.topTarget;
++ }
++}
++class Draggable2 {
++ constructor(handler) {
++ this.handler = handler;
++ handler.on("mousedown", this._dragStart, this);
++ handler.on("mousemove", this._drag, this);
++ handler.on("mouseup", this._dragEnd, this);
++ }
++ _dragStart(e2) {
++ let draggingTarget = e2.target;
++ while (draggingTarget && !draggingTarget.draggable) {
++ draggingTarget = draggingTarget.parent;
++ }
++ if (draggingTarget) {
++ this._draggingTarget = draggingTarget;
++ draggingTarget.dragging = true;
++ this._x = e2.offsetX;
++ this._y = e2.offsetY;
++ this.handler.dispatchToElement(new Param(draggingTarget, e2), "dragstart", e2.event);
++ }
++ }
++ _drag(e2) {
++ const draggingTarget = this._draggingTarget;
++ if (draggingTarget) {
++ const x = e2.offsetX;
++ const y = e2.offsetY;
++ const dx = x - this._x;
++ const dy = y - this._y;
++ this._x = x;
++ this._y = y;
++ draggingTarget.drift(dx, dy, e2);
++ this.handler.dispatchToElement(new Param(draggingTarget, e2), "drag", e2.event);
++ const dropTarget = this.handler.findHover(x, y, draggingTarget).target;
++ const lastDropTarget = this._dropTarget;
++ this._dropTarget = dropTarget;
++ if (draggingTarget !== dropTarget) {
++ if (lastDropTarget && dropTarget !== lastDropTarget) {
++ this.handler.dispatchToElement(new Param(lastDropTarget, e2), "dragleave", e2.event);
++ }
++ if (dropTarget && dropTarget !== lastDropTarget) {
++ this.handler.dispatchToElement(new Param(dropTarget, e2), "dragenter", e2.event);
}
}
}
--
-- return -1;
}
++ _dragEnd(e2) {
++ const draggingTarget = this._draggingTarget;
++ if (draggingTarget) {
++ draggingTarget.dragging = false;
++ }
++ this.handler.dispatchToElement(new Param(draggingTarget, e2), "dragend", e2.event);
++ if (this._dropTarget) {
++ this.handler.dispatchToElement(new Param(this._dropTarget, e2), "drop", e2.event);
++ }
++ this._draggingTarget = null;
++ this._dropTarget = null;
++ }
++}
-- function inherits(clazz, baseClazz) {
-- var clazzPrototype = clazz.prototype;
--
-- function F() {}
--
-- F.prototype = baseClazz.prototype;
-- clazz.prototype = new F();
--
-- for (var prop in clazzPrototype) {
-- if (clazzPrototype.hasOwnProperty(prop)) {
-- clazz.prototype[prop] = clazzPrototype[prop];
++// node_modules/zrender/src/core/Eventful.ts
++class Eventful2 {
++ constructor(eventProcessors) {
++ if (eventProcessors) {
++ this._$eventProcessor = eventProcessors;
++ }
++ }
++ on(event6, query, handler, context) {
++ if (!this._$handlers) {
++ this._$handlers = {};
++ }
++ const _h = this._$handlers;
++ if (typeof query === "function") {
++ context = handler;
++ handler = query;
++ query = null;
++ }
++ if (!handler || !event6) {
++ return this;
++ }
++ const eventProcessor = this._$eventProcessor;
++ if (query != null && eventProcessor && eventProcessor.normalizeQuery) {
++ query = eventProcessor.normalizeQuery(query);
++ }
++ if (!_h[event6]) {
++ _h[event6] = [];
++ }
++ for (let i = 0; i < _h[event6].length; i++) {
++ if (_h[event6][i].h === handler) {
++ return this;
}
}
--
-- clazz.prototype.constructor = clazz;
-- clazz.superClass = baseClazz;
++ const wrap = {
++ h: handler,
++ query,
++ ctx: context || this,
++ callAtLast: handler.zrEventfulCallAtLast
++ };
++ const lastIndex = _h[event6].length - 1;
++ const lastWrap = _h[event6][lastIndex];
++ lastWrap && lastWrap.callAtLast ? _h[event6].splice(lastIndex, 0, wrap) : _h[event6].push(wrap);
++ return this;
}
--
-- function mixin(target, source, override) {
-- target = 'prototype' in target ? target.prototype : target;
-- source = 'prototype' in source ? source.prototype : source;
--
-- if (Object.getOwnPropertyNames) {
-- var keyList = Object.getOwnPropertyNames(source);
--
-- for (var i = 0; i < keyList.length; i++) {
-- var key = keyList[i];
--
-- if (key !== 'constructor') {
-- if (override ? source[key] != null : target[key] == null) {
-- target[key] = source[key];
++ isSilent(eventName) {
++ const _h = this._$handlers;
++ return !_h || !_h[eventName] || !_h[eventName].length;
++ }
++ off(eventType, handler) {
++ const _h = this._$handlers;
++ if (!_h) {
++ return this;
++ }
++ if (!eventType) {
++ this._$handlers = {};
++ return this;
++ }
++ if (handler) {
++ if (_h[eventType]) {
++ const newList = [];
++ for (let i = 0, l = _h[eventType].length; i < l; i++) {
++ if (_h[eventType][i].h !== handler) {
++ newList.push(_h[eventType][i]);
}
}
++ _h[eventType] = newList;
++ }
++ if (_h[eventType] && _h[eventType].length === 0) {
++ delete _h[eventType];
}
} else {
-- defaults(target, source, override);
++ delete _h[eventType];
}
++ return this;
}
--
-- function isArrayLike(data) {
-- if (!data) {
-- return false;
++ trigger(eventType, ...args) {
++ if (!this._$handlers) {
++ return this;
}
--
-- if (typeof data === 'string') {
-- return false;
++ const _h = this._$handlers[eventType];
++ const eventProcessor = this._$eventProcessor;
++ if (_h) {
++ const argLen = args.length;
++ const len2 = _h.length;
++ for (let i = 0; i < len2; i++) {
++ const hItem = _h[i];
++ if (eventProcessor && eventProcessor.filter && hItem.query != null && !eventProcessor.filter(eventType, hItem.query)) {
++ continue;
++ }
++ switch (argLen) {
++ case 0:
++ hItem.h.call(hItem.ctx);
++ break;
++ case 1:
++ hItem.h.call(hItem.ctx, args[0]);
++ break;
++ case 2:
++ hItem.h.call(hItem.ctx, args[0], args[1]);
++ break;
++ default:
++ hItem.h.apply(hItem.ctx, args);
++ break;
++ }
++ }
}
--
-- return typeof data.length === 'number';
++ eventProcessor && eventProcessor.afterTrigger && eventProcessor.afterTrigger(eventType);
++ return this;
}
--
-- function each(arr, cb, context) {
-- if (!(arr && cb)) {
-- return;
++ triggerWithContext(type) {
++ if (!this._$handlers) {
++ return this;
}
--
-- if (arr.forEach && arr.forEach === nativeForEach) {
-- arr.forEach(cb, context);
-- } else if (arr.length === +arr.length) {
-- for (var i = 0, len = arr.length; i < len; i++) {
-- cb.call(context, arr[i], i, arr);
-- }
-- } else {
-- for (var key in arr) {
-- if (arr.hasOwnProperty(key)) {
-- cb.call(context, arr[key], key, arr);
++ const _h = this._$handlers[type];
++ const eventProcessor = this._$eventProcessor;
++ if (_h) {
++ const args = arguments;
++ const argLen = args.length;
++ const ctx = args[argLen - 1];
++ const len2 = _h.length;
++ for (let i = 0; i < len2; i++) {
++ const hItem = _h[i];
++ if (eventProcessor && eventProcessor.filter && hItem.query != null && !eventProcessor.filter(type, hItem.query)) {
++ continue;
++ }
++ switch (argLen) {
++ case 0:
++ hItem.h.call(ctx);
++ break;
++ case 1:
++ hItem.h.call(ctx, args[0]);
++ break;
++ case 2:
++ hItem.h.call(ctx, args[0], args[1]);
++ break;
++ default:
++ hItem.h.apply(ctx, args.slice(1, argLen - 1));
++ break;
}
}
}
++ eventProcessor && eventProcessor.afterTrigger && eventProcessor.afterTrigger(type);
++ return this;
++ }
++}
++
++// node_modules/zrender/src/core/fourPointsTransform.ts
++const LN2 = Math.log(2);
++function determinant(rows, rank, rowStart, rowMask, colMask, detCache) {
++ const cacheKey = rowMask + "-" + colMask;
++ const fullRank = rows.length;
++ if (detCache.hasOwnProperty(cacheKey)) {
++ return detCache[cacheKey];
++ }
++ if (rank === 1) {
++ const colStart = Math.round(Math.log((1 << fullRank) - 1 & ~colMask) / LN2);
++ return rows[rowStart][colStart];
++ }
++ const subRowMask = rowMask | 1 << rowStart;
++ let subRowStart = rowStart + 1;
++ while (rowMask & 1 << subRowStart) {
++ subRowStart++;
++ }
++ let sum2 = 0;
++ for (let j = 0, colLocalIdx = 0; j < fullRank; j++) {
++ const colTag = 1 << j;
++ if (!(colTag & colMask)) {
++ sum2 += (colLocalIdx % 2 ? -1 : 1) * rows[rowStart][j] * determinant(rows, rank - 1, subRowStart, subRowMask, colMask | colTag, detCache);
++ colLocalIdx++;
++ }
++ }
++ detCache[cacheKey] = sum2;
++ return sum2;
++}
++function buildTransformer(src, dest) {
++ const mA = [
++ [src[0], src[1], 1, 0, 0, 0, -dest[0] * src[0], -dest[0] * src[1]],
++ [0, 0, 0, src[0], src[1], 1, -dest[1] * src[0], -dest[1] * src[1]],
++ [src[2], src[3], 1, 0, 0, 0, -dest[2] * src[2], -dest[2] * src[3]],
++ [0, 0, 0, src[2], src[3], 1, -dest[3] * src[2], -dest[3] * src[3]],
++ [src[4], src[5], 1, 0, 0, 0, -dest[4] * src[4], -dest[4] * src[5]],
++ [0, 0, 0, src[4], src[5], 1, -dest[5] * src[4], -dest[5] * src[5]],
++ [src[6], src[7], 1, 0, 0, 0, -dest[6] * src[6], -dest[6] * src[7]],
++ [0, 0, 0, src[6], src[7], 1, -dest[7] * src[6], -dest[7] * src[7]]
++ ];
++ const detCache = {};
++ const det = determinant(mA, 8, 0, 0, 0, detCache);
++ if (det === 0) {
++ return;
}
--
-- function map(arr, cb, context) {
-- if (!arr) {
-- return [];
++ const vh = [];
++ for (let i = 0; i < 8; i++) {
++ for (let j = 0; j < 8; j++) {
++ vh[j] == null && (vh[j] = 0);
++ vh[j] += ((i + j) % 2 ? -1 : 1) * determinant(mA, 7, i === 0 ? 1 : 0, 1 << i, 1 << j, detCache) / det * dest[i];
}
--
-- if (!cb) {
-- return slice(arr);
++ }
++ return function(out2, srcPointX, srcPointY) {
++ const pk = srcPointX * vh[6] + srcPointY * vh[7] + 1;
++ out2[0] = (srcPointX * vh[0] + srcPointY * vh[1] + vh[2]) / pk;
++ out2[1] = (srcPointX * vh[3] + srcPointY * vh[4] + vh[5]) / pk;
++ };
++}
++
++// node_modules/zrender/src/core/dom.ts
++const EVENT_SAVED_PROP = "___zrEVENTSAVED";
++const _calcOut = [];
++function transformLocalCoord(out2, elFrom, elTarget, inX, inY) {
++ return transformCoordWithViewport(_calcOut, elFrom, inX, inY, true) && transformCoordWithViewport(out2, elTarget, _calcOut[0], _calcOut[1]);
++}
++function transformCoordWithViewport(out2, el, inX, inY, inverse) {
++ if (el.getBoundingClientRect && env_default.domSupported && !isCanvasEl(el)) {
++ const saved = el[EVENT_SAVED_PROP] || (el[EVENT_SAVED_PROP] = {});
++ const markers = prepareCoordMarkers(el, saved);
++ const transformer = preparePointerTransformer(markers, saved, inverse);
++ if (transformer) {
++ transformer(out2, inX, inY);
++ return true;
}
--
-- if (arr.map && arr.map === nativeMap) {
-- return arr.map(cb, context);
++ }
++ return false;
++}
++function prepareCoordMarkers(el, saved) {
++ let markers = saved.markers;
++ if (markers) {
++ return markers;
++ }
++ markers = saved.markers = [];
++ const propLR = ["left", "right"];
++ const propTB = ["top", "bottom"];
++ for (let i = 0; i < 4; i++) {
++ const marker = document.createElement("div");
++ const stl = marker.style;
++ const idxLR = i % 2;
++ const idxTB = (i >> 1) % 2;
++ stl.cssText = [
++ "position: absolute",
++ "visibility: hidden",
++ "padding: 0",
++ "margin: 0",
++ "border-width: 0",
++ "user-select: none",
++ "width:0",
++ "height:0",
++ propLR[idxLR] + ":0",
++ propTB[idxTB] + ":0",
++ propLR[1 - idxLR] + ":auto",
++ propTB[1 - idxTB] + ":auto",
++ ""
++ ].join("!important;");
++ el.appendChild(marker);
++ markers.push(marker);
++ }
++ return markers;
++}
++function preparePointerTransformer(markers, saved, inverse) {
++ const transformerName = inverse ? "invTrans" : "trans";
++ const transformer = saved[transformerName];
++ const oldSrcCoords = saved.srcCoords;
++ const srcCoords = [];
++ const destCoords = [];
++ let oldCoordTheSame = true;
++ for (let i = 0; i < 4; i++) {
++ const rect = markers[i].getBoundingClientRect();
++ const ii = 2 * i;
++ const x = rect.left;
++ const y = rect.top;
++ srcCoords.push(x, y);
++ oldCoordTheSame = oldCoordTheSame && oldSrcCoords && x === oldSrcCoords[ii] && y === oldSrcCoords[ii + 1];
++ destCoords.push(markers[i].offsetLeft, markers[i].offsetTop);
++ }
++ return oldCoordTheSame && transformer ? transformer : (saved.srcCoords = srcCoords, saved[transformerName] = inverse ? buildTransformer(destCoords, srcCoords) : buildTransformer(srcCoords, destCoords));
++}
++function isCanvasEl(el) {
++ return el.nodeName.toUpperCase() === "CANVAS";
++}
++
++// node_modules/zrender/src/core/event.ts
++const isDomLevel2 = typeof window !== "undefined" && !!window.addEventListener;
++const MOUSE_EVENT_REG = /^(?:mouse|pointer|contextmenu|drag|drop)|click/;
++const _calcOut2 = [];
++function clientToLocal(el, e2, out2, calculate) {
++ out2 = out2 || {};
++ if (calculate || !env_default.canvasSupported) {
++ calculateZrXY(el, e2, out2);
++ } else if (env_default.browser.firefox && e2.layerX != null && e2.layerX !== e2.offsetX) {
++ out2.zrX = e2.layerX;
++ out2.zrY = e2.layerY;
++ } else if (e2.offsetX != null) {
++ out2.zrX = e2.offsetX;
++ out2.zrY = e2.offsetY;
++ } else {
++ calculateZrXY(el, e2, out2);
++ }
++ return out2;
++}
++function calculateZrXY(el, e2, out2) {
++ if (env_default.domSupported && el.getBoundingClientRect) {
++ const ex = e2.clientX;
++ const ey = e2.clientY;
++ if (isCanvasEl(el)) {
++ const box2 = el.getBoundingClientRect();
++ out2.zrX = ex - box2.left;
++ out2.zrY = ey - box2.top;
++ return;
} else {
-- var result = [];
--
-- for (var i = 0, len = arr.length; i < len; i++) {
-- result.push(cb.call(context, arr[i], i, arr));
++ if (transformCoordWithViewport(_calcOut2, el, ex, ey)) {
++ out2.zrX = _calcOut2[0];
++ out2.zrY = _calcOut2[1];
++ return;
}
--
-- return result;
}
}
--
-- function reduce(arr, cb, memo, context) {
-- if (!(arr && cb)) {
++ out2.zrX = out2.zrY = 0;
++}
++function getNativeEvent(e2) {
++ return e2 || window.event;
++}
++function normalizeEvent(el, e2, calculate) {
++ e2 = getNativeEvent(e2);
++ if (e2.zrX != null) {
++ return e2;
++ }
++ const eventType = e2.type;
++ const isTouch = eventType && eventType.indexOf("touch") >= 0;
++ if (!isTouch) {
++ clientToLocal(el, e2, e2, calculate);
++ const wheelDelta = getWheelDeltaMayPolyfill(e2);
++ e2.zrDelta = wheelDelta ? wheelDelta / 120 : -(e2.detail || 0) / 3;
++ } else {
++ const touch = eventType !== "touchend" ? e2.targetTouches[0] : e2.changedTouches[0];
++ touch && clientToLocal(el, touch, e2, calculate);
++ }
++ const button = e2.button;
++ if (e2.which == null && button !== void 0 && MOUSE_EVENT_REG.test(e2.type)) {
++ e2.which = button & 1 ? 1 : button & 2 ? 3 : button & 4 ? 2 : 0;
++ }
++ return e2;
++}
++function getWheelDeltaMayPolyfill(e2) {
++ const rawWheelDelta = e2.wheelDelta;
++ if (rawWheelDelta) {
++ return rawWheelDelta;
++ }
++ const deltaX = e2.deltaX;
++ const deltaY = e2.deltaY;
++ if (deltaX == null || deltaY == null) {
++ return rawWheelDelta;
++ }
++ const delta = deltaY !== 0 ? Math.abs(deltaY) : Math.abs(deltaX);
++ const sign = deltaY > 0 ? -1 : deltaY < 0 ? 1 : deltaX > 0 ? -1 : 1;
++ return 3 * delta * sign;
++}
++function addEventListener(el, name2, handler, opt) {
++ if (isDomLevel2) {
++ el.addEventListener(name2, handler, opt);
++ } else {
++ el.attachEvent("on" + name2, handler);
++ }
++}
++function removeEventListener(el, name2, handler, opt) {
++ if (isDomLevel2) {
++ el.removeEventListener(name2, handler, opt);
++ } else {
++ el.detachEvent("on" + name2, handler);
++ }
++}
++const stop = isDomLevel2 ? function(e2) {
++ e2.preventDefault();
++ e2.stopPropagation();
++ e2.cancelBubble = true;
++} : function(e2) {
++ e2.returnValue = false;
++ e2.cancelBubble = true;
++};
++function isMiddleOrRightButtonOnMouseUpDown(e2) {
++ return e2.which === 2 || e2.which === 3;
++}
++
++// node_modules/zrender/src/core/GestureMgr.ts
++class GestureMgr2 {
++ constructor() {
++ this._track = [];
++ }
++ recognize(event6, target, root) {
++ this._doTrack(event6, target, root);
++ return this._recognize(event6);
++ }
++ clear() {
++ this._track.length = 0;
++ return this;
++ }
++ _doTrack(event6, target, root) {
++ const touches = event6.touches;
++ if (!touches) {
return;
}
--
-- for (var i = 0, len = arr.length; i < len; i++) {
-- memo = cb.call(context, memo, arr[i], i, arr);
++ const trackItem = {
++ points: [],
++ touches: [],
++ target,
++ event: event6
++ };
++ for (let i = 0, len2 = touches.length; i < len2; i++) {
++ const touch = touches[i];
++ const pos = clientToLocal(root, touch, {});
++ trackItem.points.push([pos.zrX, pos.zrY]);
++ trackItem.touches.push(touch);
++ }
++ this._track.push(trackItem);
++ }
++ _recognize(event6) {
++ for (let eventName in recognizers) {
++ if (recognizers.hasOwnProperty(eventName)) {
++ const gestureInfo = recognizers[eventName](this._track, event6);
++ if (gestureInfo) {
++ return gestureInfo;
++ }
++ }
++ }
++ }
++}
++function dist2(pointPair) {
++ const dx = pointPair[1][0] - pointPair[0][0];
++ const dy = pointPair[1][1] - pointPair[0][1];
++ return Math.sqrt(dx * dx + dy * dy);
++}
++function center(pointPair) {
++ return [
++ (pointPair[0][0] + pointPair[1][0]) / 2,
++ (pointPair[0][1] + pointPair[1][1]) / 2
++ ];
++}
++const recognizers = {
++ pinch: function(tracks, event6) {
++ const trackLen = tracks.length;
++ if (!trackLen) {
++ return;
++ }
++ const pinchEnd = (tracks[trackLen - 1] || {}).points;
++ const pinchPre = (tracks[trackLen - 2] || {}).points || pinchEnd;
++ if (pinchPre && pinchPre.length > 1 && pinchEnd && pinchEnd.length > 1) {
++ let pinchScale = dist2(pinchEnd) / dist2(pinchPre);
++ !isFinite(pinchScale) && (pinchScale = 1);
++ event6.pinchScale = pinchScale;
++ const pinchCenter = center(pinchEnd);
++ event6.pinchX = pinchCenter[0];
++ event6.pinchY = pinchCenter[1];
++ return {
++ type: "pinch",
++ target: tracks[0].target,
++ event: event6
++ };
}
--
-- return memo;
}
--
-- function filter(arr, cb, context) {
-- if (!arr) {
-- return [];
++};
++
++// node_modules/zrender/src/Handler.ts
++const SILENT = "silent";
++function makeEventPacket(eveType, targetInfo, event6) {
++ return {
++ type: eveType,
++ event: event6,
++ target: targetInfo.target,
++ topTarget: targetInfo.topTarget,
++ cancelBubble: false,
++ offsetX: event6.zrX,
++ offsetY: event6.zrY,
++ gestureEvent: event6.gestureEvent,
++ pinchX: event6.pinchX,
++ pinchY: event6.pinchY,
++ pinchScale: event6.pinchScale,
++ wheelDelta: event6.zrDelta,
++ zrByTouch: event6.zrByTouch,
++ which: event6.which,
++ stop: stopEvent
++ };
++}
++function stopEvent() {
++ stop(this.event);
++}
++class EmptyProxy extends Eventful2 {
++ constructor() {
++ super(...arguments);
++ this.handler = null;
++ }
++ dispose() {
++ }
++ setCursor() {
++ }
++}
++class HoveredResult {
++ constructor(x, y) {
++ this.x = x;
++ this.y = y;
++ }
++}
++const handlerNames = [
++ "click",
++ "dblclick",
++ "mousewheel",
++ "mouseout",
++ "mouseup",
++ "mousedown",
++ "mousemove",
++ "contextmenu"
++];
++class Handler extends Eventful2 {
++ constructor(storage2, painter, proxy, painterRoot) {
++ super();
++ this._hovered = new HoveredResult(0, 0);
++ this.storage = storage2;
++ this.painter = painter;
++ this.painterRoot = painterRoot;
++ proxy = proxy || new EmptyProxy();
++ this.proxy = null;
++ this.setHandlerProxy(proxy);
++ this._draggingMgr = new Draggable2(this);
++ }
++ setHandlerProxy(proxy) {
++ if (this.proxy) {
++ this.proxy.dispose();
}
--
-- if (!cb) {
-- return slice(arr);
++ if (proxy) {
++ each(handlerNames, function(name2) {
++ proxy.on && proxy.on(name2, this[name2], this);
++ }, this);
++ proxy.handler = this;
++ }
++ this.proxy = proxy;
++ }
++ mousemove(event6) {
++ const x = event6.zrX;
++ const y = event6.zrY;
++ const isOutside = isOutsideBoundary(this, x, y);
++ let lastHovered = this._hovered;
++ let lastHoveredTarget = lastHovered.target;
++ if (lastHoveredTarget && !lastHoveredTarget.__zr) {
++ lastHovered = this.findHover(lastHovered.x, lastHovered.y);
++ lastHoveredTarget = lastHovered.target;
++ }
++ const hovered = this._hovered = isOutside ? new HoveredResult(x, y) : this.findHover(x, y);
++ const hoveredTarget = hovered.target;
++ const proxy = this.proxy;
++ proxy.setCursor && proxy.setCursor(hoveredTarget ? hoveredTarget.cursor : "default");
++ if (lastHoveredTarget && hoveredTarget !== lastHoveredTarget) {
++ this.dispatchToElement(lastHovered, "mouseout", event6);
++ }
++ this.dispatchToElement(hovered, "mousemove", event6);
++ if (hoveredTarget && hoveredTarget !== lastHoveredTarget) {
++ this.dispatchToElement(hovered, "mouseover", event6);
++ }
++ }
++ mouseout(event6) {
++ const eventControl = event6.zrEventControl;
++ const zrIsToLocalDOM = event6.zrIsToLocalDOM;
++ if (eventControl !== "only_globalout") {
++ this.dispatchToElement(this._hovered, "mouseout", event6);
++ }
++ if (eventControl !== "no_globalout") {
++ !zrIsToLocalDOM && this.trigger("globalout", {type: "globalout", event: event6});
++ }
++ }
++ resize() {
++ this._hovered = new HoveredResult(0, 0);
++ }
++ dispatch(eventName, eventArgs) {
++ const handler = this[eventName];
++ handler && handler.call(this, eventArgs);
++ }
++ dispose() {
++ this.proxy.dispose();
++ this.storage = null;
++ this.proxy = null;
++ this.painter = null;
++ }
++ setCursorStyle(cursorStyle) {
++ const proxy = this.proxy;
++ proxy.setCursor && proxy.setCursor(cursorStyle);
++ }
++ dispatchToElement(targetInfo, eventName, event6) {
++ targetInfo = targetInfo || {};
++ let el = targetInfo.target;
++ if (el && el.silent) {
++ return;
}
--
-- if (arr.filter && arr.filter === nativeFilter) {
-- return arr.filter(cb, context);
-- } else {
-- var result = [];
--
-- for (var i = 0, len = arr.length; i < len; i++) {
-- if (cb.call(context, arr[i], i, arr)) {
-- result.push(arr[i]);
-- }
++ const eventKey = "on" + eventName;
++ const eventPacket = makeEventPacket(eventName, targetInfo, event6);
++ while (el) {
++ el[eventKey] && (eventPacket.cancelBubble = !!el[eventKey].call(el, eventPacket));
++ el.trigger(eventName, eventPacket);
++ el = el.__hostTarget ? el.__hostTarget : el.parent;
++ if (eventPacket.cancelBubble) {
++ break;
}
--
-- return result;
-- }
-- }
--
-- function find(arr, cb, context) {
-- if (!(arr && cb)) {
-- return;
}
--
-- for (var i = 0, len = arr.length; i < len; i++) {
-- if (cb.call(context, arr[i], i, arr)) {
-- return arr[i];
++ if (!eventPacket.cancelBubble) {
++ this.trigger(eventName, eventPacket);
++ if (this.painter && this.painter.eachOtherLayer) {
++ this.painter.eachOtherLayer(function(layer) {
++ if (typeof layer[eventKey] === "function") {
++ layer[eventKey].call(layer, eventPacket);
++ }
++ if (layer.trigger) {
++ layer.trigger(eventName, eventPacket);
++ }
++ });
}
}
}
--
-- function keys(obj) {
-- if (!obj) {
-- return [];
++ findHover(x, y, exclude) {
++ const list = this.storage.getDisplayList();
++ const out2 = new HoveredResult(x, y);
++ for (let i = list.length - 1; i >= 0; i--) {
++ let hoverCheckResult;
++ if (list[i] !== exclude && !list[i].ignore && (hoverCheckResult = isHover(list[i], x, y))) {
++ !out2.topTarget && (out2.topTarget = list[i]);
++ if (hoverCheckResult !== SILENT) {
++ out2.target = list[i];
++ break;
++ }
++ }
}
--
-- if (Object.keys) {
-- return Object.keys(obj);
++ return out2;
++ }
++ processGesture(event6, stage) {
++ if (!this._gestureMgr) {
++ this._gestureMgr = new GestureMgr2();
++ }
++ const gestureMgr = this._gestureMgr;
++ stage === "start" && gestureMgr.clear();
++ const gestureInfo = gestureMgr.recognize(event6, this.findHover(event6.zrX, event6.zrY, null).target, this.proxy.dom);
++ stage === "end" && gestureMgr.clear();
++ if (gestureInfo) {
++ const type = gestureInfo.type;
++ event6.gestureEvent = type;
++ let res = new HoveredResult();
++ res.target = gestureInfo.target;
++ this.dispatchToElement(res, type, gestureInfo.event);
++ }
++ }
++}
++each(["click", "mousedown", "mouseup", "mousewheel", "dblclick", "contextmenu"], function(name2) {
++ Handler.prototype[name2] = function(event6) {
++ const x = event6.zrX;
++ const y = event6.zrY;
++ const isOutside = isOutsideBoundary(this, x, y);
++ let hovered;
++ let hoveredTarget;
++ if (name2 !== "mouseup" || !isOutside) {
++ hovered = this.findHover(x, y);
++ hoveredTarget = hovered.target;
++ }
++ if (name2 === "mousedown") {
++ this._downEl = hoveredTarget;
++ this._downPoint = [event6.zrX, event6.zrY];
++ this._upEl = hoveredTarget;
++ } else if (name2 === "mouseup") {
++ this._upEl = hoveredTarget;
++ } else if (name2 === "click") {
++ if (this._downEl !== this._upEl || !this._downPoint || dist(this._downPoint, [event6.zrX, event6.zrY]) > 4) {
++ return;
++ }
++ this._downPoint = null;
}
--
-- var keyList = [];
--
-- for (var key in obj) {
-- if (obj.hasOwnProperty(key)) {
-- keyList.push(key);
++ this.dispatchToElement(hovered, name2, event6);
++ };
++});
++function isHover(displayable, x, y) {
++ if (displayable[displayable.rectHover ? "rectContain" : "contain"](x, y)) {
++ let el = displayable;
++ let isSilent;
++ let ignoreClip = false;
++ while (el) {
++ if (el.ignoreClip) {
++ ignoreClip = true;
}
++ if (!ignoreClip) {
++ let clipPath = el.getClipPath();
++ if (clipPath && !clipPath.contain(x, y)) {
++ return false;
++ }
++ if (el.silent) {
++ isSilent = true;
++ }
++ }
++ const hostEl = el.__hostTarget;
++ el = hostEl ? hostEl : el.parent;
++ }
++ return isSilent ? SILENT : true;
++ }
++ return false;
++}
++function isOutsideBoundary(handlerInstance, x, y) {
++ const painter = handlerInstance.painter;
++ return x < 0 || x > painter.getWidth() || y < 0 || y > painter.getHeight();
++}
++const Handler_default = Handler;
++
++// node_modules/zrender/src/core/matrix.ts
++const matrix_exports = {};
++__export(matrix_exports, {
++ clone: () => clone,
++ copy: () => copy,
++ create: () => create,
++ identity: () => identity,
++ invert: () => invert,
++ mul: () => mul,
++ rotate: () => rotate,
++ scale: () => scale,
++ translate: () => translate
++});
++function create() {
++ return [1, 0, 0, 1, 0, 0];
++}
++function identity(out2) {
++ out2[0] = 1;
++ out2[1] = 0;
++ out2[2] = 0;
++ out2[3] = 1;
++ out2[4] = 0;
++ out2[5] = 0;
++ return out2;
++}
++function copy(out2, m2) {
++ out2[0] = m2[0];
++ out2[1] = m2[1];
++ out2[2] = m2[2];
++ out2[3] = m2[3];
++ out2[4] = m2[4];
++ out2[5] = m2[5];
++ return out2;
++}
++function mul(out2, m1, m2) {
++ const out0 = m1[0] * m2[0] + m1[2] * m2[1];
++ const out1 = m1[1] * m2[0] + m1[3] * m2[1];
++ const out22 = m1[0] * m2[2] + m1[2] * m2[3];
++ const out3 = m1[1] * m2[2] + m1[3] * m2[3];
++ const out4 = m1[0] * m2[4] + m1[2] * m2[5] + m1[4];
++ const out5 = m1[1] * m2[4] + m1[3] * m2[5] + m1[5];
++ out2[0] = out0;
++ out2[1] = out1;
++ out2[2] = out22;
++ out2[3] = out3;
++ out2[4] = out4;
++ out2[5] = out5;
++ return out2;
++}
++function translate(out2, a, v) {
++ out2[0] = a[0];
++ out2[1] = a[1];
++ out2[2] = a[2];
++ out2[3] = a[3];
++ out2[4] = a[4] + v[0];
++ out2[5] = a[5] + v[1];
++ return out2;
++}
++function rotate(out2, a, rad) {
++ const aa = a[0];
++ const ac = a[2];
++ const atx = a[4];
++ const ab = a[1];
++ const ad = a[3];
++ const aty = a[5];
++ const st = Math.sin(rad);
++ const ct = Math.cos(rad);
++ out2[0] = aa * ct + ab * st;
++ out2[1] = -aa * st + ab * ct;
++ out2[2] = ac * ct + ad * st;
++ out2[3] = -ac * st + ct * ad;
++ out2[4] = ct * atx + st * aty;
++ out2[5] = ct * aty - st * atx;
++ return out2;
++}
++function scale(out2, a, v) {
++ const vx = v[0];
++ const vy = v[1];
++ out2[0] = a[0] * vx;
++ out2[1] = a[1] * vy;
++ out2[2] = a[2] * vx;
++ out2[3] = a[3] * vy;
++ out2[4] = a[4] * vx;
++ out2[5] = a[5] * vy;
++ return out2;
++}
++function invert(out2, a) {
++ const aa = a[0];
++ const ac = a[2];
++ const atx = a[4];
++ const ab = a[1];
++ const ad = a[3];
++ const aty = a[5];
++ let det = aa * ad - ab * ac;
++ if (!det) {
++ return null;
++ }
++ det = 1 / det;
++ out2[0] = ad * det;
++ out2[1] = -ab * det;
++ out2[2] = -ac * det;
++ out2[3] = aa * det;
++ out2[4] = (ac * aty - ad * atx) * det;
++ out2[5] = (ab * atx - aa * aty) * det;
++ return out2;
++}
++function clone(a) {
++ const b = create();
++ copy(b, a);
++ return b;
++}
++
++// node_modules/zrender/src/core/Transformable.ts
++const mIdentity = identity;
++const EPSILON3 = 5e-5;
++function isNotAroundZero(val) {
++ return val > EPSILON3 || val < -EPSILON3;
++}
++const scaleTmp = [];
++const tmpTransform = [];
++const originTransform = create();
++const abs = Math.abs;
++class Transformable2 {
++ setPosition(arr) {
++ this.x = arr[0];
++ this.y = arr[1];
++ }
++ setScale(arr) {
++ this.scaleX = arr[0];
++ this.scaleY = arr[1];
++ }
++ setOrigin(arr) {
++ this.originX = arr[0];
++ this.originY = arr[1];
++ }
++ needLocalTransform() {
++ return isNotAroundZero(this.rotation) || isNotAroundZero(this.x) || isNotAroundZero(this.y) || isNotAroundZero(this.scaleX - 1) || isNotAroundZero(this.scaleY - 1);
++ }
++ updateTransform() {
++ const parent = this.parent;
++ const parentHasTransform = parent && parent.transform;
++ const needLocalTransform = this.needLocalTransform();
++ let m2 = this.transform;
++ if (!(needLocalTransform || parentHasTransform)) {
++ m2 && mIdentity(m2);
++ return;
}
--
-- return keyList;
++ m2 = m2 || create();
++ if (needLocalTransform) {
++ this.getLocalTransform(m2);
++ } else {
++ mIdentity(m2);
++ }
++ if (parentHasTransform) {
++ if (needLocalTransform) {
++ mul(m2, parent.transform, m2);
++ } else {
++ copy(m2, parent.transform);
++ }
++ }
++ this.transform = m2;
++ this._resolveGlobalScaleRatio(m2);
}
--
-- function bindPolyfill(func, context) {
-- var args = [];
--
-- for (var _i = 2; _i < arguments.length; _i++) {
-- args[_i - 2] = arguments[_i];
++ _resolveGlobalScaleRatio(m2) {
++ const globalScaleRatio = this.globalScaleRatio;
++ if (globalScaleRatio != null && globalScaleRatio !== 1) {
++ this.getGlobalScale(scaleTmp);
++ const relX = scaleTmp[0] < 0 ? -1 : 1;
++ const relY = scaleTmp[1] < 0 ? -1 : 1;
++ const sx = ((scaleTmp[0] - relX) * globalScaleRatio + relX) / scaleTmp[0] || 0;
++ const sy = ((scaleTmp[1] - relY) * globalScaleRatio + relY) / scaleTmp[1] || 0;
++ m2[0] *= sx;
++ m2[1] *= sx;
++ m2[2] *= sy;
++ m2[3] *= sy;
}
--
-- return function () {
-- return func.apply(context, args.concat(nativeSlice.call(arguments)));
-- };
++ this.invTransform = this.invTransform || create();
++ invert(this.invTransform, m2);
}
--
-- var bind = protoFunction && isFunction(protoFunction.bind) ? protoFunction.call.bind(protoFunction.bind) : bindPolyfill;
--
-- function curry(func) {
-- var args = [];
--
-- for (var _i = 1; _i < arguments.length; _i++) {
-- args[_i - 1] = arguments[_i];
++ getLocalTransform(m2) {
++ return Transformable2.getLocalTransform(this, m2);
++ }
++ getComputedTransform() {
++ let transformNode = this;
++ const ancestors = [];
++ while (transformNode) {
++ ancestors.push(transformNode);
++ transformNode = transformNode.parent;
}
--
-- return function () {
-- return func.apply(this, args.concat(nativeSlice.call(arguments)));
-- };
++ while (transformNode = ancestors.pop()) {
++ transformNode.updateTransform();
++ }
++ return this.transform;
}
--
-- function isArray(value) {
-- if (Array.isArray) {
-- return Array.isArray(value);
++ setLocalTransform(m2) {
++ if (!m2) {
++ return;
}
--
-- return objToString.call(value) === '[object Array]';
++ let sx = m2[0] * m2[0] + m2[1] * m2[1];
++ let sy = m2[2] * m2[2] + m2[3] * m2[3];
++ if (isNotAroundZero(sx - 1)) {
++ sx = Math.sqrt(sx);
++ }
++ if (isNotAroundZero(sy - 1)) {
++ sy = Math.sqrt(sy);
++ }
++ this.rotation = Math.atan2(-m2[1] / sy, m2[0] / sx);
++ if (m2[0] < 0) {
++ sx = -sx;
++ }
++ if (m2[3] < 0) {
++ sy = -sy;
++ }
++ if (sx < 0 && sy < 0) {
++ this.rotation += Math.PI;
++ sx = -sx;
++ sy = -sy;
++ }
++ this.x = m2[4];
++ this.y = m2[5];
++ this.scaleX = sx;
++ this.scaleY = sy;
}
--
-- function isFunction(value) {
-- return typeof value === 'function';
++ decomposeTransform() {
++ if (!this.transform) {
++ return;
++ }
++ const parent = this.parent;
++ let m2 = this.transform;
++ if (parent && parent.transform) {
++ mul(tmpTransform, parent.invTransform, m2);
++ m2 = tmpTransform;
++ }
++ const ox = this.originX;
++ const oy = this.originY;
++ if (ox || oy) {
++ originTransform[4] = ox;
++ originTransform[5] = oy;
++ mul(tmpTransform, m2, originTransform);
++ tmpTransform[4] -= ox;
++ tmpTransform[5] -= oy;
++ m2 = tmpTransform;
++ }
++ this.setLocalTransform(m2);
++ }
++ getGlobalScale(out2) {
++ const m2 = this.transform;
++ out2 = out2 || [];
++ if (!m2) {
++ out2[0] = 1;
++ out2[1] = 1;
++ return out2;
++ }
++ out2[0] = Math.sqrt(m2[0] * m2[0] + m2[1] * m2[1]);
++ out2[1] = Math.sqrt(m2[2] * m2[2] + m2[3] * m2[3]);
++ if (m2[0] < 0) {
++ out2[0] = -out2[0];
++ }
++ if (m2[3] < 0) {
++ out2[1] = -out2[1];
++ }
++ return out2;
++ }
++ transformCoordToLocal(x, y) {
++ const v22 = [x, y];
++ const invTransform = this.invTransform;
++ if (invTransform) {
++ applyTransform(v22, v22, invTransform);
++ }
++ return v22;
++ }
++ transformCoordToGlobal(x, y) {
++ const v22 = [x, y];
++ const transform8 = this.transform;
++ if (transform8) {
++ applyTransform(v22, v22, transform8);
++ }
++ return v22;
++ }
++ getLineScale() {
++ const m2 = this.transform;
++ return m2 && abs(m2[0] - 1) > 1e-10 && abs(m2[3] - 1) > 1e-10 ? Math.sqrt(abs(m2[0] * m2[3] - m2[2] * m2[1])) : 1;
++ }
++ static getLocalTransform(target, m2) {
++ m2 = m2 || [];
++ mIdentity(m2);
++ const ox = target.originX || 0;
++ const oy = target.originY || 0;
++ const sx = target.scaleX;
++ const sy = target.scaleY;
++ const rotation = target.rotation || 0;
++ const x = target.x;
++ const y = target.y;
++ m2[4] -= ox;
++ m2[5] -= oy;
++ m2[0] *= sx;
++ m2[1] *= sy;
++ m2[2] *= sx;
++ m2[3] *= sy;
++ m2[4] *= sx;
++ m2[5] *= sy;
++ if (rotation) {
++ rotate(m2, m2, rotation);
++ }
++ m2[4] += ox;
++ m2[5] += oy;
++ m2[4] += x;
++ m2[5] += y;
++ return m2;
++ }
++}
++Transformable2.initDefaultProps = function() {
++ const proto2 = Transformable2.prototype;
++ proto2.x = 0;
++ proto2.y = 0;
++ proto2.scaleX = 1;
++ proto2.scaleY = 1;
++ proto2.originX = 0;
++ proto2.originY = 0;
++ proto2.rotation = 0;
++ proto2.globalScaleRatio = 1;
++}();
++const Transformable_default = Transformable2;
++
++// node_modules/zrender/src/animation/easing.ts
++const easing4 = {
++ linear(k) {
++ return k;
++ },
++ quadraticIn(k) {
++ return k * k;
++ },
++ quadraticOut(k) {
++ return k * (2 - k);
++ },
++ quadraticInOut(k) {
++ if ((k *= 2) < 1) {
++ return 0.5 * k * k;
++ }
++ return -0.5 * (--k * (k - 2) - 1);
++ },
++ cubicIn(k) {
++ return k * k * k;
++ },
++ cubicOut(k) {
++ return --k * k * k + 1;
++ },
++ cubicInOut(k) {
++ if ((k *= 2) < 1) {
++ return 0.5 * k * k * k;
++ }
++ return 0.5 * ((k -= 2) * k * k + 2);
++ },
++ quarticIn(k) {
++ return k * k * k * k;
++ },
++ quarticOut(k) {
++ return 1 - --k * k * k * k;
++ },
++ quarticInOut(k) {
++ if ((k *= 2) < 1) {
++ return 0.5 * k * k * k * k;
++ }
++ return -0.5 * ((k -= 2) * k * k * k - 2);
++ },
++ quinticIn(k) {
++ return k * k * k * k * k;
++ },
++ quinticOut(k) {
++ return --k * k * k * k * k + 1;
++ },
++ quinticInOut(k) {
++ if ((k *= 2) < 1) {
++ return 0.5 * k * k * k * k * k;
++ }
++ return 0.5 * ((k -= 2) * k * k * k * k + 2);
++ },
++ sinusoidalIn(k) {
++ return 1 - Math.cos(k * Math.PI / 2);
++ },
++ sinusoidalOut(k) {
++ return Math.sin(k * Math.PI / 2);
++ },
++ sinusoidalInOut(k) {
++ return 0.5 * (1 - Math.cos(Math.PI * k));
++ },
++ exponentialIn(k) {
++ return k === 0 ? 0 : Math.pow(1024, k - 1);
++ },
++ exponentialOut(k) {
++ return k === 1 ? 1 : 1 - Math.pow(2, -10 * k);
++ },
++ exponentialInOut(k) {
++ if (k === 0) {
++ return 0;
++ }
++ if (k === 1) {
++ return 1;
++ }
++ if ((k *= 2) < 1) {
++ return 0.5 * Math.pow(1024, k - 1);
++ }
++ return 0.5 * (-Math.pow(2, -10 * (k - 1)) + 2);
++ },
++ circularIn(k) {
++ return 1 - Math.sqrt(1 - k * k);
++ },
++ circularOut(k) {
++ return Math.sqrt(1 - --k * k);
++ },
++ circularInOut(k) {
++ if ((k *= 2) < 1) {
++ return -0.5 * (Math.sqrt(1 - k * k) - 1);
++ }
++ return 0.5 * (Math.sqrt(1 - (k -= 2) * k) + 1);
++ },
++ elasticIn(k) {
++ let s;
++ let a = 0.1;
++ let p = 0.4;
++ if (k === 0) {
++ return 0;
++ }
++ if (k === 1) {
++ return 1;
++ }
++ if (!a || a < 1) {
++ a = 1;
++ s = p / 4;
++ } else {
++ s = p * Math.asin(1 / a) / (2 * Math.PI);
++ }
++ return -(a * Math.pow(2, 10 * (k -= 1)) * Math.sin((k - s) * (2 * Math.PI) / p));
++ },
++ elasticOut(k) {
++ let s;
++ let a = 0.1;
++ let p = 0.4;
++ if (k === 0) {
++ return 0;
++ }
++ if (k === 1) {
++ return 1;
++ }
++ if (!a || a < 1) {
++ a = 1;
++ s = p / 4;
++ } else {
++ s = p * Math.asin(1 / a) / (2 * Math.PI);
++ }
++ return a * Math.pow(2, -10 * k) * Math.sin((k - s) * (2 * Math.PI) / p) + 1;
++ },
++ elasticInOut(k) {
++ let s;
++ let a = 0.1;
++ let p = 0.4;
++ if (k === 0) {
++ return 0;
++ }
++ if (k === 1) {
++ return 1;
++ }
++ if (!a || a < 1) {
++ a = 1;
++ s = p / 4;
++ } else {
++ s = p * Math.asin(1 / a) / (2 * Math.PI);
++ }
++ if ((k *= 2) < 1) {
++ return -0.5 * (a * Math.pow(2, 10 * (k -= 1)) * Math.sin((k - s) * (2 * Math.PI) / p));
++ }
++ return a * Math.pow(2, -10 * (k -= 1)) * Math.sin((k - s) * (2 * Math.PI) / p) * 0.5 + 1;
++ },
++ backIn(k) {
++ let s = 1.70158;
++ return k * k * ((s + 1) * k - s);
++ },
++ backOut(k) {
++ let s = 1.70158;
++ return --k * k * ((s + 1) * k + s) + 1;
++ },
++ backInOut(k) {
++ let s = 1.70158 * 1.525;
++ if ((k *= 2) < 1) {
++ return 0.5 * (k * k * ((s + 1) * k - s));
++ }
++ return 0.5 * ((k -= 2) * k * ((s + 1) * k + s) + 2);
++ },
++ bounceIn(k) {
++ return 1 - easing4.bounceOut(1 - k);
++ },
++ bounceOut(k) {
++ if (k < 1 / 2.75) {
++ return 7.5625 * k * k;
++ } else if (k < 2 / 2.75) {
++ return 7.5625 * (k -= 1.5 / 2.75) * k + 0.75;
++ } else if (k < 2.5 / 2.75) {
++ return 7.5625 * (k -= 2.25 / 2.75) * k + 0.9375;
++ } else {
++ return 7.5625 * (k -= 2.625 / 2.75) * k + 0.984375;
++ }
++ },
++ bounceInOut(k) {
++ if (k < 0.5) {
++ return easing4.bounceIn(k * 2) * 0.5;
++ }
++ return easing4.bounceOut(k * 2 - 1) * 0.5 + 0.5;
++ }
++};
++const easing_default = easing4;
++
++// node_modules/zrender/src/animation/Clip.ts
++class Clip4 {
++ constructor(opts) {
++ this._initialized = false;
++ this._startTime = 0;
++ this._pausedTime = 0;
++ this._paused = false;
++ this._life = opts.life || 1e3;
++ this._delay = opts.delay || 0;
++ this.loop = opts.loop == null ? false : opts.loop;
++ this.gap = opts.gap || 0;
++ this.easing = opts.easing || "linear";
++ this.onframe = opts.onframe;
++ this.ondestroy = opts.ondestroy;
++ this.onrestart = opts.onrestart;
++ }
++ step(globalTime, deltaTime) {
++ if (!this._initialized) {
++ this._startTime = globalTime + this._delay;
++ this._initialized = true;
++ }
++ if (this._paused) {
++ this._pausedTime += deltaTime;
++ return;
++ }
++ let percent = (globalTime - this._startTime - this._pausedTime) / this._life;
++ if (percent < 0) {
++ percent = 0;
++ }
++ percent = Math.min(percent, 1);
++ const easing8 = this.easing;
++ const easingFunc = typeof easing8 === "string" ? easing_default[easing8] : easing8;
++ const schedule = typeof easingFunc === "function" ? easingFunc(percent) : percent;
++ this.onframe && this.onframe(schedule);
++ if (percent === 1) {
++ if (this.loop) {
++ this._restart(globalTime);
++ this.onrestart && this.onrestart();
++ } else {
++ return true;
++ }
++ }
++ return false;
}
--
-- function isString(value) {
-- return typeof value === 'string';
++ _restart(globalTime) {
++ const remainder = (globalTime - this._startTime - this._pausedTime) % this._life;
++ this._startTime = globalTime - remainder + this.gap;
++ this._pausedTime = 0;
}
--
-- function isStringSafe(value) {
-- return objToString.call(value) === '[object String]';
++ pause() {
++ this._paused = true;
}
--
-- function isNumber(value) {
-- return typeof value === 'number';
++ resume() {
++ this._paused = false;
}
++}
-- function isObject(value) {
-- var type = typeof value;
-- return type === 'function' || !!value && type === 'object';
++// node_modules/zrender/src/core/LRU.ts
++class Entry {
++ constructor(val) {
++ this.value = val;
}
--
-- function isBuiltInObject(value) {
-- return !!BUILTIN_OBJECT[objToString.call(value)];
++}
++class LinkedList {
++ constructor() {
++ this._len = 0;
}
--
-- function isTypedArray(value) {
-- return !!TYPED_ARRAY[objToString.call(value)];
++ insert(val) {
++ const entry = new Entry(val);
++ this.insertEntry(entry);
++ return entry;
}
--
-- function isDom(value) {
-- return typeof value === 'object' && typeof value.nodeType === 'number' && typeof value.ownerDocument === 'object';
++ insertEntry(entry) {
++ if (!this.head) {
++ this.head = this.tail = entry;
++ } else {
++ this.tail.next = entry;
++ entry.prev = this.tail;
++ entry.next = null;
++ this.tail = entry;
++ }
++ this._len++;
++ }
++ remove(entry) {
++ const prev = entry.prev;
++ const next = entry.next;
++ if (prev) {
++ prev.next = next;
++ } else {
++ this.head = next;
++ }
++ if (next) {
++ next.prev = prev;
++ } else {
++ this.tail = prev;
++ }
++ entry.next = entry.prev = null;
++ this._len--;
++ }
++ len() {
++ return this._len;
++ }
++ clear() {
++ this.head = this.tail = null;
++ this._len = 0;
++ }
++}
++class LRU2 {
++ constructor(maxSize) {
++ this._list = new LinkedList();
++ this._maxSize = 10;
++ this._map = {};
++ this._maxSize = maxSize;
++ }
++ put(key, value) {
++ const list = this._list;
++ const map4 = this._map;
++ let removed = null;
++ if (map4[key] == null) {
++ const len2 = list.len();
++ let entry = this._lastRemovedEntry;
++ if (len2 >= this._maxSize && len2 > 0) {
++ const leastUsedEntry = list.head;
++ list.remove(leastUsedEntry);
++ delete map4[leastUsedEntry.key];
++ removed = leastUsedEntry.value;
++ this._lastRemovedEntry = leastUsedEntry;
++ }
++ if (entry) {
++ entry.value = value;
++ } else {
++ entry = new Entry(value);
++ }
++ entry.key = key;
++ list.insertEntry(entry);
++ map4[key] = entry;
++ }
++ return removed;
}
--
-- function isGradientObject(value) {
-- return value.colorStops != null;
++ get(key) {
++ const entry = this._map[key];
++ const list = this._list;
++ if (entry != null) {
++ if (entry !== list.tail) {
++ list.remove(entry);
++ list.insertEntry(entry);
++ }
++ return entry.value;
++ }
++ }
++ clear() {
++ this._list.clear();
++ this._map = {};
++ }
++ len() {
++ return this._list.len();
++ }
++}
++
++// node_modules/zrender/src/tool/color.ts
++const color_exports = {};
++__export(color_exports, {
++ fastLerp: () => fastLerp,
++ fastMapToColor: () => fastMapToColor,
++ lerp: () => lerp2,
++ lift: () => lift,
++ lum: () => lum,
++ mapToColor: () => mapToColor,
++ modifyAlpha: () => modifyAlpha,
++ modifyHSL: () => modifyHSL,
++ parse: () => parse,
++ random: () => random,
++ stringify: () => stringify,
++ toHex: () => toHex
++});
++const kCSSColorTable = {
++ 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 clampCssByte(i) {
++ i = Math.round(i);
++ return i < 0 ? 0 : i > 255 ? 255 : i;
++}
++function clampCssAngle(i) {
++ i = Math.round(i);
++ return i < 0 ? 0 : i > 360 ? 360 : i;
++}
++function clampCssFloat(f) {
++ return f < 0 ? 0 : f > 1 ? 1 : f;
++}
++function parseCssInt(val) {
++ let str = val;
++ if (str.length && str.charAt(str.length - 1) === "%") {
++ return clampCssByte(parseFloat(str) / 100 * 255);
++ }
++ return clampCssByte(parseInt(str, 10));
++}
++function parseCssFloat(val) {
++ let str = val;
++ if (str.length && str.charAt(str.length - 1) === "%") {
++ return clampCssFloat(parseFloat(str) / 100);
++ }
++ return clampCssFloat(parseFloat(str));
++}
++function cssHueToRgb(m1, m2, h) {
++ if (h < 0) {
++ h += 1;
++ } else if (h > 1) {
++ h -= 1;
++ }
++ if (h * 6 < 1) {
++ return m1 + (m2 - m1) * h * 6;
++ }
++ if (h * 2 < 1) {
++ return m2;
++ }
++ if (h * 3 < 2) {
++ return m1 + (m2 - m1) * (2 / 3 - h) * 6;
++ }
++ return m1;
++}
++function lerpNumber(a, b, p) {
++ return a + (b - a) * p;
++}
++function setRgba(out2, r, g, b, a) {
++ out2[0] = r;
++ out2[1] = g;
++ out2[2] = b;
++ out2[3] = a;
++ return out2;
++}
++function copyRgba(out2, a) {
++ out2[0] = a[0];
++ out2[1] = a[1];
++ out2[2] = a[2];
++ out2[3] = a[3];
++ return out2;
++}
++const colorCache = new LRU2(20);
++let lastRemovedArr = null;
++function putToCache(colorStr, rgbaArr) {
++ if (lastRemovedArr) {
++ copyRgba(lastRemovedArr, rgbaArr);
++ }
++ lastRemovedArr = colorCache.put(colorStr, lastRemovedArr || rgbaArr.slice());
++}
++function parse(colorStr, rgbaArr) {
++ if (!colorStr) {
++ return;
}
--
-- function isPatternObject(value) {
-- return value.image != null;
++ rgbaArr = rgbaArr || [];
++ let cached = colorCache.get(colorStr);
++ if (cached) {
++ return copyRgba(rgbaArr, cached);
++ }
++ colorStr = colorStr + "";
++ let str = colorStr.replace(/ /g, "").toLowerCase();
++ if (str in kCSSColorTable) {
++ copyRgba(rgbaArr, kCSSColorTable[str]);
++ putToCache(colorStr, rgbaArr);
++ return rgbaArr;
++ }
++ const strLen = str.length;
++ if (str.charAt(0) === "#") {
++ if (strLen === 4 || strLen === 5) {
++ const iv = parseInt(str.slice(1, 4), 16);
++ if (!(iv >= 0 && iv <= 4095)) {
++ setRgba(rgbaArr, 0, 0, 0, 1);
++ return;
++ }
++ setRgba(rgbaArr, (iv & 3840) >> 4 | (iv & 3840) >> 8, iv & 240 | (iv & 240) >> 4, iv & 15 | (iv & 15) << 4, strLen === 5 ? parseInt(str.slice(4), 16) / 15 : 1);
++ putToCache(colorStr, rgbaArr);
++ return rgbaArr;
++ } else if (strLen === 7 || strLen === 9) {
++ const iv = parseInt(str.slice(1, 7), 16);
++ if (!(iv >= 0 && iv <= 16777215)) {
++ setRgba(rgbaArr, 0, 0, 0, 1);
++ return;
++ }
++ setRgba(rgbaArr, (iv & 16711680) >> 16, (iv & 65280) >> 8, iv & 255, strLen === 9 ? parseInt(str.slice(7), 16) / 255 : 1);
++ putToCache(colorStr, rgbaArr);
++ return rgbaArr;
++ }
++ return;
}
--
-- function isRegExp(value) {
-- return objToString.call(value) === '[object RegExp]';
++ let op = str.indexOf("(");
++ let ep = str.indexOf(")");
++ if (op !== -1 && ep + 1 === strLen) {
++ let fname = str.substr(0, op);
++ let params = str.substr(op + 1, ep - (op + 1)).split(",");
++ let alpha = 1;
++ switch (fname) {
++ case "rgba":
++ if (params.length !== 4) {
++ return params.length === 3 ? setRgba(rgbaArr, +params[0], +params[1], +params[2], 1) : setRgba(rgbaArr, 0, 0, 0, 1);
++ }
++ alpha = parseCssFloat(params.pop());
++ case "rgb":
++ if (params.length !== 3) {
++ setRgba(rgbaArr, 0, 0, 0, 1);
++ return;
++ }
++ setRgba(rgbaArr, parseCssInt(params[0]), parseCssInt(params[1]), parseCssInt(params[2]), alpha);
++ putToCache(colorStr, rgbaArr);
++ return rgbaArr;
++ case "hsla":
++ if (params.length !== 4) {
++ setRgba(rgbaArr, 0, 0, 0, 1);
++ return;
++ }
++ params[3] = parseCssFloat(params[3]);
++ hsla2rgba(params, rgbaArr);
++ putToCache(colorStr, rgbaArr);
++ return rgbaArr;
++ case "hsl":
++ if (params.length !== 3) {
++ setRgba(rgbaArr, 0, 0, 0, 1);
++ return;
++ }
++ hsla2rgba(params, rgbaArr);
++ putToCache(colorStr, rgbaArr);
++ return rgbaArr;
++ default:
++ return;
++ }
}
--
-- function eqNaN(value) {
-- return value !== value;
++ setRgba(rgbaArr, 0, 0, 0, 1);
++ return;
++}
++function hsla2rgba(hsla, rgba) {
++ const h = (parseFloat(hsla[0]) % 360 + 360) % 360 / 360;
++ const s = parseCssFloat(hsla[1]);
++ const l = parseCssFloat(hsla[2]);
++ const m2 = l <= 0.5 ? l * (s + 1) : l + s - l * s;
++ const m1 = l * 2 - m2;
++ rgba = rgba || [];
++ setRgba(rgba, clampCssByte(cssHueToRgb(m1, m2, h + 1 / 3) * 255), clampCssByte(cssHueToRgb(m1, m2, h) * 255), clampCssByte(cssHueToRgb(m1, m2, h - 1 / 3) * 255), 1);
++ if (hsla.length === 4) {
++ rgba[3] = hsla[3];
++ }
++ return rgba;
++}
++function rgba2hsla(rgba) {
++ if (!rgba) {
++ return;
}
--
-- function retrieve() {
-- var args = [];
--
-- for (var _i = 0; _i < arguments.length; _i++) {
-- args[_i] = arguments[_i];
-- }
--
-- for (var i = 0, len = args.length; i < len; i++) {
-- if (args[i] != null) {
-- return args[i];
++ const R = rgba[0] / 255;
++ const G = rgba[1] / 255;
++ const B = rgba[2] / 255;
++ const vMin = Math.min(R, G, B);
++ const vMax = Math.max(R, G, B);
++ const delta = vMax - vMin;
++ const L = (vMax + vMin) / 2;
++ let H;
++ let S;
++ if (delta === 0) {
++ H = 0;
++ S = 0;
++ } else {
++ if (L < 0.5) {
++ S = delta / (vMax + vMin);
++ } else {
++ S = delta / (2 - vMax - vMin);
++ }
++ const deltaR = ((vMax - R) / 6 + delta / 2) / delta;
++ const deltaG = ((vMax - G) / 6 + delta / 2) / delta;
++ const deltaB = ((vMax - B) / 6 + delta / 2) / delta;
++ if (R === vMax) {
++ H = deltaB - deltaG;
++ } else if (G === vMax) {
++ H = 1 / 3 + deltaR - deltaB;
++ } else if (B === vMax) {
++ H = 2 / 3 + deltaG - deltaR;
++ }
++ if (H < 0) {
++ H += 1;
++ }
++ if (H > 1) {
++ H -= 1;
++ }
++ }
++ const hsla = [H * 360, S, L];
++ if (rgba[3] != null) {
++ hsla.push(rgba[3]);
++ }
++ return hsla;
++}
++function lift(color9, level) {
++ const colorArr = parse(color9);
++ if (colorArr) {
++ for (let i = 0; i < 3; i++) {
++ if (level < 0) {
++ colorArr[i] = colorArr[i] * (1 - level) | 0;
++ } else {
++ colorArr[i] = (255 - colorArr[i]) * level + colorArr[i] | 0;
++ }
++ if (colorArr[i] > 255) {
++ colorArr[i] = 255;
++ } else if (colorArr[i] < 0) {
++ colorArr[i] = 0;
}
}
++ return stringify(colorArr, colorArr.length === 4 ? "rgba" : "rgb");
}
--
-- function retrieve2(value0, value1) {
-- return value0 != null ? value0 : value1;
++}
++function toHex(color9) {
++ const colorArr = parse(color9);
++ if (colorArr) {
++ return ((1 << 24) + (colorArr[0] << 16) + (colorArr[1] << 8) + +colorArr[2]).toString(16).slice(1);
}
--
-- function retrieve3(value0, value1, value2) {
-- return value0 != null ? value0 : value1 != null ? value1 : value2;
++}
++function fastLerp(normalizedValue, colors, out2) {
++ if (!(colors && colors.length) || !(normalizedValue >= 0 && normalizedValue <= 1)) {
++ return;
}
--
-- function slice(arr) {
-- var args = [];
--
-- for (var _i = 1; _i < arguments.length; _i++) {
-- args[_i - 1] = arguments[_i];
-- }
--
-- return nativeSlice.apply(arr, args);
++ out2 = out2 || [];
++ const value = normalizedValue * (colors.length - 1);
++ const leftIndex = Math.floor(value);
++ const rightIndex = Math.ceil(value);
++ const leftColor = colors[leftIndex];
++ const rightColor = colors[rightIndex];
++ const dv = value - leftIndex;
++ out2[0] = clampCssByte(lerpNumber(leftColor[0], rightColor[0], dv));
++ out2[1] = clampCssByte(lerpNumber(leftColor[1], rightColor[1], dv));
++ out2[2] = clampCssByte(lerpNumber(leftColor[2], rightColor[2], dv));
++ out2[3] = clampCssFloat(lerpNumber(leftColor[3], rightColor[3], dv));
++ return out2;
++}
++const fastMapToColor = fastLerp;
++function lerp2(normalizedValue, colors, fullOutput) {
++ if (!(colors && colors.length) || !(normalizedValue >= 0 && normalizedValue <= 1)) {
++ return;
}
--
-- function normalizeCssArray(val) {
-- if (typeof val === 'number') {
-- return [val, val, val, val];
-- }
--
-- var len = val.length;
--
-- if (len === 2) {
-- return [val[0], val[1], val[0], val[1]];
-- } else if (len === 3) {
-- return [val[0], val[1], val[2], val[1]];
-- }
--
-- return val;
++ const value = normalizedValue * (colors.length - 1);
++ const leftIndex = Math.floor(value);
++ const rightIndex = Math.ceil(value);
++ const leftColor = parse(colors[leftIndex]);
++ const rightColor = parse(colors[rightIndex]);
++ const dv = value - leftIndex;
++ const color9 = stringify([
++ clampCssByte(lerpNumber(leftColor[0], rightColor[0], dv)),
++ clampCssByte(lerpNumber(leftColor[1], rightColor[1], dv)),
++ clampCssByte(lerpNumber(leftColor[2], rightColor[2], dv)),
++ clampCssFloat(lerpNumber(leftColor[3], rightColor[3], dv))
++ ], "rgba");
++ return fullOutput ? {
++ color: color9,
++ leftIndex,
++ rightIndex,
++ value
++ } : color9;
++}
++const mapToColor = lerp2;
++function modifyHSL(color9, h, s, l) {
++ let colorArr = parse(color9);
++ if (color9) {
++ colorArr = rgba2hsla(colorArr);
++ h != null && (colorArr[0] = clampCssAngle(h));
++ s != null && (colorArr[1] = parseCssFloat(s));
++ l != null && (colorArr[2] = parseCssFloat(l));
++ return stringify(hsla2rgba(colorArr), "rgba");
++ }
++}
++function modifyAlpha(color9, alpha) {
++ const colorArr = parse(color9);
++ if (colorArr && alpha != null) {
++ colorArr[3] = clampCssFloat(alpha);
++ return stringify(colorArr, "rgba");
++ }
++}
++function stringify(arrColor, type) {
++ if (!arrColor || !arrColor.length) {
++ return;
}
--
-- function assert(condition, message) {
-- if (!condition) {
-- throw new Error(message);
++ let colorStr = arrColor[0] + "," + arrColor[1] + "," + arrColor[2];
++ if (type === "rgba" || type === "hsva" || type === "hsla") {
++ colorStr += "," + arrColor[3];
++ }
++ return type + "(" + colorStr + ")";
++}
++function lum(color9, backgroundLum) {
++ const arr = parse(color9);
++ return arr ? (0.299 * arr[0] + 0.587 * arr[1] + 0.114 * arr[2]) * arr[3] / 255 + (1 - arr[3]) * backgroundLum : 0;
++}
++function random() {
++ let r = Math.round(Math.random() * 255);
++ let g = Math.round(Math.random() * 255);
++ let b = Math.round(Math.random() * 255);
++ return "rgb(" + r + "," + g + "," + b + ")";
++}
++
++// node_modules/zrender/src/animation/Animator.ts
++const arraySlice = Array.prototype.slice;
++function interpolateNumber(p0, p1, percent) {
++ return (p1 - p0) * percent + p0;
++}
++function step(p0, p1, percent) {
++ return percent > 0.5 ? p1 : p0;
++}
++function interpolate1DArray(out2, p0, p1, percent) {
++ const len2 = p0.length;
++ for (let i = 0; i < len2; i++) {
++ out2[i] = interpolateNumber(p0[i], p1[i], percent);
++ }
++}
++function interpolate2DArray(out2, p0, p1, percent) {
++ const len2 = p0.length;
++ const len22 = len2 && p0[0].length;
++ for (let i = 0; i < len2; i++) {
++ if (!out2[i]) {
++ out2[i] = [];
++ }
++ for (let j = 0; j < len22; j++) {
++ out2[i][j] = interpolateNumber(p0[i][j], p1[i][j], percent);
++ }
++ }
++}
++function add1DArray(out2, p0, p1, sign) {
++ const len2 = p0.length;
++ for (let i = 0; i < len2; i++) {
++ out2[i] = p0[i] + p1[i] * sign;
++ }
++ return out2;
++}
++function add2DArray(out2, p0, p1, sign) {
++ const len2 = p0.length;
++ const len22 = len2 && p0[0].length;
++ for (let i = 0; i < len2; i++) {
++ if (!out2[i]) {
++ out2[i] = [];
++ }
++ for (let j = 0; j < len22; j++) {
++ out2[i][j] = p0[i][j] + p1[i][j] * sign;
++ }
++ }
++ return out2;
++}
++function fillArray(val0, val1, arrDim) {
++ let arr0 = val0;
++ let arr1 = val1;
++ if (!arr0.push || !arr1.push) {
++ return;
++ }
++ const arr0Len = arr0.length;
++ const arr1Len = arr1.length;
++ if (arr0Len !== arr1Len) {
++ const isPreviousLarger = arr0Len > arr1Len;
++ if (isPreviousLarger) {
++ arr0.length = arr1Len;
++ } else {
++ for (let i = arr0Len; i < arr1Len; i++) {
++ arr0.push(arrDim === 1 ? arr1[i] : arraySlice.call(arr1[i]));
++ }
}
}
--
-- function trim(str) {
-- if (str == null) {
-- return null;
-- } else if (typeof str.trim === 'function') {
-- return str.trim();
++ const len2 = arr0[0] && arr0[0].length;
++ for (let i = 0; i < arr0.length; i++) {
++ if (arrDim === 1) {
++ if (isNaN(arr0[i])) {
++ arr0[i] = arr1[i];
++ }
} else {
-- return str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, '');
++ for (let j = 0; j < len2; j++) {
++ if (isNaN(arr0[i][j])) {
++ arr0[i][j] = arr1[i][j];
++ }
++ }
}
}
--
-- var primitiveKey = '__ec_primitive__';
--
-- function setAsPrimitive(obj) {
-- obj[primitiveKey] = true;
++}
++function is1DArraySame(arr0, arr1) {
++ const len2 = arr0.length;
++ if (len2 !== arr1.length) {
++ return false;
}
--
-- function isPrimitive(obj) {
-- return obj[primitiveKey];
++ for (let i = 0; i < len2; i++) {
++ if (arr0[i] !== arr1[i]) {
++ return false;
++ }
}
--
-- var HashMap = function () {
-- function HashMap(obj) {
-- this.data = {};
-- var isArr = isArray(obj);
-- this.data = {};
-- var thisMap = this;
-- obj instanceof HashMap ? obj.each(visit) : obj && each(obj, visit);
--
-- function visit(value, key) {
-- isArr ? thisMap.set(value, key) : thisMap.set(key, value);
++ return true;
++}
++function catmullRomInterpolate(p0, p1, p2, p3, t, t2, t3) {
++ const v0 = (p2 - p0) * 0.5;
++ const v12 = (p3 - p1) * 0.5;
++ return (2 * (p1 - p2) + v0 + v12) * t3 + (-3 * (p1 - p2) - 2 * v0 - v12) * t2 + v0 * t + p1;
++}
++function catmullRomInterpolate1DArray(out2, p0, p1, p2, p3, t, t2, t3) {
++ const len2 = p0.length;
++ for (let i = 0; i < len2; i++) {
++ out2[i] = catmullRomInterpolate(p0[i], p1[i], p2[i], p3[i], t, t2, t3);
++ }
++}
++function catmullRomInterpolate2DArray(out2, p0, p1, p2, p3, t, t2, t3) {
++ const len2 = p0.length;
++ const len22 = p0[0].length;
++ for (let i = 0; i < len2; i++) {
++ if (!out2[i]) {
++ out2[1] = [];
++ }
++ for (let j = 0; j < len22; j++) {
++ out2[i][j] = catmullRomInterpolate(p0[i][j], p1[i][j], p2[i][j], p3[i][j], t, t2, t3);
++ }
++ }
++}
++function cloneValue(value) {
++ if (isArrayLike(value)) {
++ const len2 = value.length;
++ if (isArrayLike(value[0])) {
++ const ret = [];
++ for (let i = 0; i < len2; i++) {
++ ret.push(arraySlice.call(value[i]));
}
++ return ret;
}
--
-- HashMap.prototype.get = function (key) {
-- return this.data.hasOwnProperty(key) ? this.data[key] : null;
-- };
--
-- HashMap.prototype.set = function (key, value) {
-- return this.data[key] = value;
-- };
--
-- HashMap.prototype.each = function (cb, context) {
-- for (var key in this.data) {
-- if (this.data.hasOwnProperty(key)) {
-- cb.call(context, this.data[key], key);
++ return arraySlice.call(value);
++ }
++ return value;
++}
++function rgba2String(rgba) {
++ rgba[0] = Math.floor(rgba[0]);
++ rgba[1] = Math.floor(rgba[1]);
++ rgba[2] = Math.floor(rgba[2]);
++ return "rgba(" + rgba.join(",") + ")";
++}
++function guessArrayDim(value) {
++ return isArrayLike(value && value[0]) ? 2 : 1;
++}
++let tmpRgba = [0, 0, 0, 0];
++class Track {
++ constructor(propName) {
++ this.keyframes = [];
++ this.maxTime = 0;
++ this.arrDim = 0;
++ this.interpolable = true;
++ this._needsSort = false;
++ this._isAllValueEqual = true;
++ this._lastFrame = 0;
++ this._lastFramePercent = 0;
++ this.propName = propName;
++ }
++ isFinished() {
++ return this._finished;
++ }
++ setFinished() {
++ this._finished = true;
++ if (this._additiveTrack) {
++ this._additiveTrack.setFinished();
++ }
++ }
++ needsAnimate() {
++ return !this._isAllValueEqual && this.keyframes.length >= 2 && this.interpolable;
++ }
++ getAdditiveTrack() {
++ return this._additiveTrack;
++ }
++ addKeyframe(time4, value) {
++ if (time4 >= this.maxTime) {
++ this.maxTime = time4;
++ } else {
++ this._needsSort = true;
++ }
++ let keyframes = this.keyframes;
++ let len2 = keyframes.length;
++ if (this.interpolable) {
++ if (isArrayLike(value)) {
++ let arrayDim = guessArrayDim(value);
++ if (len2 > 0 && this.arrDim !== arrayDim) {
++ this.interpolable = false;
++ return;
++ }
++ if (arrayDim === 1 && typeof value[0] !== "number" || arrayDim === 2 && typeof value[0][0] !== "number") {
++ this.interpolable = false;
++ return;
++ }
++ if (len2 > 0) {
++ let lastFrame = keyframes[len2 - 1];
++ if (this._isAllValueEqual) {
++ if (arrayDim === 1) {
++ if (!is1DArraySame(value, lastFrame.value)) {
++ this._isAllValueEqual = false;
++ }
++ } else {
++ this._isAllValueEqual = false;
++ }
++ }
++ }
++ this.arrDim = arrayDim;
++ } else {
++ if (this.arrDim > 0) {
++ this.interpolable = false;
++ return;
++ }
++ if (typeof value === "string") {
++ const colorArray = parse(value);
++ if (colorArray) {
++ value = colorArray;
++ this.isValueColor = true;
++ } else {
++ this.interpolable = false;
++ }
++ } else if (typeof value !== "number") {
++ this.interpolable = false;
++ return;
++ }
++ if (this._isAllValueEqual && len2 > 0) {
++ let lastFrame = keyframes[len2 - 1];
++ if (this.isValueColor && !is1DArraySame(lastFrame.value, value)) {
++ this._isAllValueEqual = false;
++ } else if (lastFrame.value !== value) {
++ this._isAllValueEqual = false;
++ }
}
}
++ }
++ const kf = {
++ time: time4,
++ value,
++ percent: 0
};
--
-- HashMap.prototype.keys = function () {
-- return keys(this.data);
-- };
--
-- HashMap.prototype.removeKey = function (key) {
-- delete this.data[key];
-- };
--
-- return HashMap;
-- }();
--
-- function createHashMap(obj) {
-- return new HashMap(obj);
++ this.keyframes.push(kf);
++ return kf;
}
--
-- function concatArray(a, b) {
-- var newArray = new a.constructor(a.length + b.length);
--
-- for (var i = 0; i < a.length; i++) {
-- newArray[i] = a[i];
++ prepare(additiveTrack) {
++ let kfs = this.keyframes;
++ if (this._needsSort) {
++ kfs.sort(function(a, b) {
++ return a.time - b.time;
++ });
}
--
-- var offset = a.length;
--
-- for (var i = 0; i < b.length; i++) {
-- newArray[i + offset] = b[i];
++ const arrDim = this.arrDim;
++ const kfsLen = kfs.length;
++ const lastKf = kfs[kfsLen - 1];
++ for (let i = 0; i < kfsLen; i++) {
++ kfs[i].percent = kfs[i].time / this.maxTime;
++ if (arrDim > 0 && i !== kfsLen - 1) {
++ fillArray(kfs[i].value, lastKf.value, arrDim);
++ }
++ }
++ if (additiveTrack && this.needsAnimate() && additiveTrack.needsAnimate() && arrDim === additiveTrack.arrDim && this.isValueColor === additiveTrack.isValueColor && !additiveTrack._finished) {
++ this._additiveTrack = additiveTrack;
++ const startValue = kfs[0].value;
++ for (let i = 0; i < kfsLen; i++) {
++ if (arrDim === 0) {
++ if (this.isValueColor) {
++ kfs[i].additiveValue = add1DArray([], kfs[i].value, startValue, -1);
++ } else {
++ kfs[i].additiveValue = kfs[i].value - startValue;
++ }
++ } else if (arrDim === 1) {
++ kfs[i].additiveValue = add1DArray([], kfs[i].value, startValue, -1);
++ } else if (arrDim === 2) {
++ kfs[i].additiveValue = add2DArray([], kfs[i].value, startValue, -1);
++ }
++ }
}
--
-- return newArray;
}
--
-- function createObject(proto, properties) {
-- var obj;
--
-- if (Object.create) {
-- obj = Object.create(proto);
++ step(target, percent) {
++ if (this._finished) {
++ return;
++ }
++ if (this._additiveTrack && this._additiveTrack._finished) {
++ this._additiveTrack = null;
++ }
++ const isAdditive = this._additiveTrack != null;
++ const valueKey = isAdditive ? "additiveValue" : "value";
++ const keyframes = this.keyframes;
++ const kfsNum = this.keyframes.length;
++ const propName = this.propName;
++ const arrDim = this.arrDim;
++ const isValueColor = this.isValueColor;
++ let frameIdx;
++ if (percent < 0) {
++ frameIdx = 0;
++ } else if (percent < this._lastFramePercent) {
++ const start2 = Math.min(this._lastFrame + 1, kfsNum - 1);
++ for (frameIdx = start2; frameIdx >= 0; frameIdx--) {
++ if (keyframes[frameIdx].percent <= percent) {
++ break;
++ }
++ }
++ frameIdx = Math.min(frameIdx, kfsNum - 2);
} else {
-- var StyleCtor = function () {};
--
-- StyleCtor.prototype = proto;
-- obj = new StyleCtor();
++ for (frameIdx = this._lastFrame; frameIdx < kfsNum; frameIdx++) {
++ if (keyframes[frameIdx].percent > percent) {
++ break;
++ }
++ }
++ frameIdx = Math.min(frameIdx - 1, kfsNum - 2);
}
--
-- if (properties) {
-- extend(obj, properties);
++ let nextFrame = keyframes[frameIdx + 1];
++ let frame = keyframes[frameIdx];
++ if (!(frame && nextFrame)) {
++ return;
}
--
-- return obj;
-- }
--
-- function hasOwn(own, prop) {
-- return own.hasOwnProperty(prop);
-- }
--
-- function noop() {}
--
-- var zrUtil = /*#__PURE__*/Object.freeze({
-- __proto__: null,
-- $override: $override,
-- guid: guid,
-- logError: logError,
-- clone: clone,
-- merge: merge,
-- mergeAll: mergeAll,
-- extend: extend,
-- defaults: defaults,
-- createCanvas: createCanvas,
-- indexOf: indexOf,
-- inherits: inherits,
-- mixin: mixin,
-- isArrayLike: isArrayLike,
-- each: each,
-- map: map,
-- reduce: reduce,
-- filter: filter,
-- find: find,
-- keys: keys,
-- bind: bind,
-- curry: curry,
-- isArray: isArray,
-- isFunction: isFunction,
-- isString: isString,
-- isStringSafe: isStringSafe,
-- isNumber: isNumber,
-- isObject: isObject,
-- isBuiltInObject: isBuiltInObject,
-- isTypedArray: isTypedArray,
-- isDom: isDom,
-- isGradientObject: isGradientObject,
-- isPatternObject: isPatternObject,
-- isRegExp: isRegExp,
-- eqNaN: eqNaN,
-- retrieve: retrieve,
-- retrieve2: retrieve2,
-- retrieve3: retrieve3,
-- slice: slice,
-- normalizeCssArray: normalizeCssArray,
-- assert: assert,
-- trim: trim,
-- setAsPrimitive: setAsPrimitive,
-- isPrimitive: isPrimitive,
-- HashMap: HashMap,
-- createHashMap: createHashMap,
-- concatArray: concatArray,
-- createObject: createObject,
-- hasOwn: hasOwn,
-- noop: noop
-- });
--
-- function create(x, y) {
-- if (x == null) {
-- x = 0;
++ this._lastFrame = frameIdx;
++ this._lastFramePercent = percent;
++ const range = nextFrame.percent - frame.percent;
++ if (range === 0) {
++ return;
}
--
-- if (y == null) {
-- y = 0;
++ const w = (percent - frame.percent) / range;
++ let targetArr = isAdditive ? this._additiveValue : isValueColor ? tmpRgba : target[propName];
++ if ((arrDim > 0 || isValueColor) && !targetArr) {
++ targetArr = this._additiveValue = [];
++ }
++ if (this.useSpline) {
++ const p1 = keyframes[frameIdx][valueKey];
++ const p0 = keyframes[frameIdx === 0 ? frameIdx : frameIdx - 1][valueKey];
++ const p2 = keyframes[frameIdx > kfsNum - 2 ? kfsNum - 1 : frameIdx + 1][valueKey];
++ const p3 = keyframes[frameIdx > kfsNum - 3 ? kfsNum - 1 : frameIdx + 2][valueKey];
++ if (arrDim > 0) {
++ arrDim === 1 ? catmullRomInterpolate1DArray(targetArr, p0, p1, p2, p3, w, w * w, w * w * w) : catmullRomInterpolate2DArray(targetArr, p0, p1, p2, p3, w, w * w, w * w * w);
++ } else if (isValueColor) {
++ catmullRomInterpolate1DArray(targetArr, p0, p1, p2, p3, w, w * w, w * w * w);
++ if (!isAdditive) {
++ target[propName] = rgba2String(targetArr);
++ }
++ } else {
++ let value;
++ if (!this.interpolable) {
++ value = p2;
++ } else {
++ value = catmullRomInterpolate(p0, p1, p2, p3, w, w * w, w * w * w);
++ }
++ if (isAdditive) {
++ this._additiveValue = value;
++ } else {
++ target[propName] = value;
++ }
++ }
++ } else {
++ if (arrDim > 0) {
++ arrDim === 1 ? interpolate1DArray(targetArr, frame[valueKey], nextFrame[valueKey], w) : interpolate2DArray(targetArr, frame[valueKey], nextFrame[valueKey], w);
++ } else if (isValueColor) {
++ interpolate1DArray(targetArr, frame[valueKey], nextFrame[valueKey], w);
++ if (!isAdditive) {
++ target[propName] = rgba2String(targetArr);
++ }
++ } else {
++ let value;
++ if (!this.interpolable) {
++ value = step(frame[valueKey], nextFrame[valueKey], w);
++ } else {
++ value = interpolateNumber(frame[valueKey], nextFrame[valueKey], w);
++ }
++ if (isAdditive) {
++ this._additiveValue = value;
++ } else {
++ target[propName] = value;
++ }
++ }
++ }
++ if (isAdditive) {
++ this._addToTarget(target);
}
--
-- return [x, y];
}
--
-- function copy(out, v) {
-- out[0] = v[0];
-- out[1] = v[1];
-- return out;
++ _addToTarget(target) {
++ const arrDim = this.arrDim;
++ const propName = this.propName;
++ const additiveValue = this._additiveValue;
++ if (arrDim === 0) {
++ if (this.isValueColor) {
++ parse(target[propName], tmpRgba);
++ add1DArray(tmpRgba, tmpRgba, additiveValue, 1);
++ target[propName] = rgba2String(tmpRgba);
++ } else {
++ target[propName] = target[propName] + additiveValue;
++ }
++ } else if (arrDim === 1) {
++ add1DArray(target[propName], target[propName], additiveValue, 1);
++ } else if (arrDim === 2) {
++ add2DArray(target[propName], target[propName], additiveValue, 1);
++ }
++ }
++}
++class Animator2 {
++ constructor(target, loop, additiveTo) {
++ this._tracks = {};
++ this._trackKeys = [];
++ this._delay = 0;
++ this._maxTime = 0;
++ this._paused = false;
++ this._started = 0;
++ this._clip = null;
++ this._target = target;
++ this._loop = loop;
++ if (loop) {
++ logError("Can' use additive animation on looped animation.");
++ return;
++ }
++ this._additiveAnimators = additiveTo;
}
--
-- function clone$1(v) {
-- return [v[0], v[1]];
++ getTarget() {
++ return this._target;
}
--
-- function set(out, a, b) {
-- out[0] = a;
-- out[1] = b;
-- return out;
++ changeTarget(target) {
++ this._target = target;
}
--
-- function add(out, v1, v2) {
-- out[0] = v1[0] + v2[0];
-- out[1] = v1[1] + v2[1];
-- return out;
++ when(time4, props) {
++ return this.whenWithKeys(time4, props, keys(props));
}
--
-- function scaleAndAdd(out, v1, v2, a) {
-- out[0] = v1[0] + v2[0] * a;
-- out[1] = v1[1] + v2[1] * a;
-- return out;
++ whenWithKeys(time4, props, propNames) {
++ const tracks = this._tracks;
++ for (let i = 0; i < propNames.length; i++) {
++ const propName = propNames[i];
++ let track = tracks[propName];
++ if (!track) {
++ track = tracks[propName] = new Track(propName);
++ let initialValue;
++ const additiveTrack = this._getAdditiveTrack(propName);
++ if (additiveTrack) {
++ const lastFinalKf = additiveTrack.keyframes[additiveTrack.keyframes.length - 1];
++ initialValue = lastFinalKf && lastFinalKf.value;
++ if (additiveTrack.isValueColor && initialValue) {
++ initialValue = rgba2String(initialValue);
++ }
++ } else {
++ initialValue = this._target[propName];
++ }
++ if (initialValue == null) {
++ continue;
++ }
++ if (time4 !== 0) {
++ track.addKeyframe(0, cloneValue(initialValue));
++ }
++ this._trackKeys.push(propName);
++ }
++ track.addKeyframe(time4, cloneValue(props[propName]));
++ }
++ this._maxTime = Math.max(this._maxTime, time4);
++ return this;
}
--
-- function sub(out, v1, v2) {
-- out[0] = v1[0] - v2[0];
-- out[1] = v1[1] - v2[1];
-- return out;
++ pause() {
++ this._clip.pause();
++ this._paused = true;
}
--
-- function len(v) {
-- return Math.sqrt(lenSquare(v));
++ resume() {
++ this._clip.resume();
++ this._paused = false;
}
--
-- var length = len;
--
-- function lenSquare(v) {
-- return v[0] * v[0] + v[1] * v[1];
++ isPaused() {
++ return !!this._paused;
}
--
-- var lengthSquare = lenSquare;
--
-- function mul(out, v1, v2) {
-- out[0] = v1[0] * v2[0];
-- out[1] = v1[1] * v2[1];
-- return out;
++ _doneCallback() {
++ this._setTracksFinished();
++ this._clip = null;
++ const doneList = this._doneList;
++ if (doneList) {
++ const len2 = doneList.length;
++ for (let i = 0; i < len2; i++) {
++ doneList[i].call(this);
++ }
++ }
}
--
-- function div(out, v1, v2) {
-- out[0] = v1[0] / v2[0];
-- out[1] = v1[1] / v2[1];
-- return out;
++ _abortedCallback() {
++ this._setTracksFinished();
++ const animation = this.animation;
++ const abortedList = this._abortedList;
++ if (animation) {
++ animation.removeClip(this._clip);
++ }
++ this._clip = null;
++ if (abortedList) {
++ for (let i = 0; i < abortedList.length; i++) {
++ abortedList[i].call(this);
++ }
++ }
}
--
-- function dot(v1, v2) {
-- return v1[0] * v2[0] + v1[1] * v2[1];
++ _setTracksFinished() {
++ const tracks = this._tracks;
++ const tracksKeys = this._trackKeys;
++ for (let i = 0; i < tracksKeys.length; i++) {
++ tracks[tracksKeys[i]].setFinished();
++ }
}
--
-- function scale(out, v, s) {
-- out[0] = v[0] * s;
-- out[1] = v[1] * s;
-- return out;
++ _getAdditiveTrack(trackName) {
++ let additiveTrack;
++ const additiveAnimators = this._additiveAnimators;
++ if (additiveAnimators) {
++ for (let i = 0; i < additiveAnimators.length; i++) {
++ const track = additiveAnimators[i].getTrack(trackName);
++ if (track) {
++ additiveTrack = track;
++ }
++ }
++ }
++ return additiveTrack;
}
--
-- function normalize(out, v) {
-- var d = len(v);
--
-- if (d === 0) {
-- out[0] = 0;
-- out[1] = 0;
++ start(easing8, forceAnimate) {
++ if (this._started > 0) {
++ return;
++ }
++ this._started = 1;
++ const self2 = this;
++ let tracks = [];
++ for (let i = 0; i < this._trackKeys.length; i++) {
++ const propName = this._trackKeys[i];
++ const track = this._tracks[propName];
++ const additiveTrack = this._getAdditiveTrack(propName);
++ const kfs = track.keyframes;
++ track.prepare(additiveTrack);
++ if (track.needsAnimate()) {
++ tracks.push(track);
++ } else if (!track.interpolable) {
++ const lastKf = kfs[kfs.length - 1];
++ if (lastKf) {
++ self2._target[track.propName] = lastKf.value;
++ }
++ }
++ }
++ if (tracks.length || forceAnimate) {
++ const clip2 = new Clip4({
++ life: this._maxTime,
++ loop: this._loop,
++ delay: this._delay,
++ onframe(percent) {
++ self2._started = 2;
++ const additiveAnimators = self2._additiveAnimators;
++ if (additiveAnimators) {
++ let stillHasAdditiveAnimator = false;
++ for (let i = 0; i < additiveAnimators.length; i++) {
++ if (additiveAnimators[i]._clip) {
++ stillHasAdditiveAnimator = true;
++ break;
++ }
++ }
++ if (!stillHasAdditiveAnimator) {
++ self2._additiveAnimators = null;
++ }
++ }
++ for (let i = 0; i < tracks.length; i++) {
++ tracks[i].step(self2._target, percent);
++ }
++ const onframeList = self2._onframeList;
++ if (onframeList) {
++ for (let i = 0; i < onframeList.length; i++) {
++ onframeList[i](self2._target, percent);
++ }
++ }
++ },
++ ondestroy() {
++ self2._doneCallback();
++ }
++ });
++ this._clip = clip2;
++ if (this.animation) {
++ this.animation.addClip(clip2);
++ }
++ if (easing8 && easing8 !== "spline") {
++ clip2.easing = easing8;
++ }
} else {
-- out[0] = v[0] / d;
-- out[1] = v[1] / d;
++ this._doneCallback();
}
--
-- return out;
++ return this;
}
--
-- function distance(v1, v2) {
-- return Math.sqrt((v1[0] - v2[0]) * (v1[0] - v2[0]) + (v1[1] - v2[1]) * (v1[1] - v2[1]));
++ stop(forwardToLast) {
++ if (!this._clip) {
++ return;
++ }
++ const clip2 = this._clip;
++ if (forwardToLast) {
++ clip2.onframe(1);
++ }
++ this._abortedCallback();
}
--
-- var dist = distance;
--
-- function distanceSquare(v1, v2) {
-- return (v1[0] - v2[0]) * (v1[0] - v2[0]) + (v1[1] - v2[1]) * (v1[1] - v2[1]);
++ delay(time4) {
++ this._delay = time4;
++ return this;
}
--
-- var distSquare = distanceSquare;
--
-- function negate(out, v) {
-- out[0] = -v[0];
-- out[1] = -v[1];
-- return out;
++ during(cb) {
++ if (cb) {
++ if (!this._onframeList) {
++ this._onframeList = [];
++ }
++ this._onframeList.push(cb);
++ }
++ return this;
}
--
-- function lerp(out, v1, v2, t) {
-- out[0] = v1[0] + t * (v2[0] - v1[0]);
-- out[1] = v1[1] + t * (v2[1] - v1[1]);
-- return out;
++ done(cb) {
++ if (cb) {
++ if (!this._doneList) {
++ this._doneList = [];
++ }
++ this._doneList.push(cb);
++ }
++ return this;
}
--
-- function applyTransform(out, v, m) {
-- var x = v[0];
-- var y = v[1];
-- out[0] = m[0] * x + m[2] * y + m[4];
-- out[1] = m[1] * x + m[3] * y + m[5];
-- return out;
++ aborted(cb) {
++ if (cb) {
++ if (!this._abortedList) {
++ this._abortedList = [];
++ }
++ this._abortedList.push(cb);
++ }
++ return this;
}
--
-- function min(out, v1, v2) {
-- out[0] = Math.min(v1[0], v2[0]);
-- out[1] = Math.min(v1[1], v2[1]);
-- return out;
++ getClip() {
++ return this._clip;
}
--
-- function max(out, v1, v2) {
-- out[0] = Math.max(v1[0], v2[0]);
-- out[1] = Math.max(v1[1], v2[1]);
-- return out;
++ getTrack(propName) {
++ return this._tracks[propName];
}
--
-- var vector = /*#__PURE__*/Object.freeze({
-- __proto__: null,
-- create: create,
-- copy: copy,
-- clone: clone$1,
-- set: set,
-- add: add,
-- scaleAndAdd: scaleAndAdd,
-- sub: sub,
-- len: len,
-- length: length,
-- lenSquare: lenSquare,
-- lengthSquare: lengthSquare,
-- mul: mul,
-- div: div,
-- dot: dot,
-- scale: scale,
-- normalize: normalize,
-- distance: distance,
-- dist: dist,
-- distanceSquare: distanceSquare,
-- distSquare: distSquare,
-- negate: negate,
-- lerp: lerp,
-- applyTransform: applyTransform,
-- min: min,
-- max: max
-- });
--
-- var Param = function () {
-- function Param(target, e) {
-- this.target = target;
-- this.topTarget = e && e.topTarget;
-- }
--
-- return Param;
-- }();
--
-- var Draggable = function () {
-- function Draggable(handler) {
-- this.handler = handler;
-- handler.on('mousedown', this._dragStart, this);
-- handler.on('mousemove', this._drag, this);
-- handler.on('mouseup', this._dragEnd, this);
++ stopTracks(propNames, forwardToLast) {
++ if (!propNames.length || !this._clip) {
++ return true;
}
--
-- Draggable.prototype._dragStart = function (e) {
-- var draggingTarget = e.target;
--
-- while (draggingTarget && !draggingTarget.draggable) {
-- draggingTarget = draggingTarget.parent;
-- }
--
-- if (draggingTarget) {
-- this._draggingTarget = draggingTarget;
-- draggingTarget.dragging = true;
-- this._x = e.offsetX;
-- this._y = e.offsetY;
-- this.handler.dispatchToElement(new Param(draggingTarget, e), 'dragstart', e.event);
-- }
-- };
--
-- Draggable.prototype._drag = function (e) {
-- var draggingTarget = this._draggingTarget;
--
-- if (draggingTarget) {
-- var x = e.offsetX;
-- var y = e.offsetY;
-- var dx = x - this._x;
-- var dy = y - this._y;
-- this._x = x;
-- this._y = y;
-- draggingTarget.drift(dx, dy, e);
-- this.handler.dispatchToElement(new Param(draggingTarget, e), 'drag', e.event);
-- var dropTarget = this.handler.findHover(x, y, draggingTarget).target;
-- var lastDropTarget = this._dropTarget;
-- this._dropTarget = dropTarget;
--
-- if (draggingTarget !== dropTarget) {
-- if (lastDropTarget && dropTarget !== lastDropTarget) {
-- this.handler.dispatchToElement(new Param(lastDropTarget, e), 'dragleave', e.event);
-- }
--
-- if (dropTarget && dropTarget !== lastDropTarget) {
-- this.handler.dispatchToElement(new Param(dropTarget, e), 'dragenter', e.event);
-- }
++ const tracks = this._tracks;
++ const tracksKeys = this._trackKeys;
++ for (let i = 0; i < propNames.length; i++) {
++ const track = tracks[propNames[i]];
++ if (track) {
++ if (forwardToLast) {
++ track.step(this._target, 1);
++ } else if (this._started === 1) {
++ track.step(this._target, 0);
}
-- }
-- };
--
-- Draggable.prototype._dragEnd = function (e) {
-- var draggingTarget = this._draggingTarget;
--
-- if (draggingTarget) {
-- draggingTarget.dragging = false;
-- }
--
-- this.handler.dispatchToElement(new Param(draggingTarget, e), 'dragend', e.event);
--
-- if (this._dropTarget) {
-- this.handler.dispatchToElement(new Param(this._dropTarget, e), 'drop', e.event);
-- }
--
-- this._draggingTarget = null;
-- this._dropTarget = null;
-- };
--
-- return Draggable;
-- }();
--
-- var Eventful = function () {
-- function Eventful(eventProcessors) {
-- if (eventProcessors) {
-- this._$eventProcessor = eventProcessors;
++ track.setFinished();
}
}
--
-- Eventful.prototype.on = function (event, query, handler, context) {
-- if (!this._$handlers) {
-- this._$handlers = {};
-- }
--
-- var _h = this._$handlers;
--
-- if (typeof query === 'function') {
-- context = handler;
-- handler = query;
-- query = null;
-- }
--
-- if (!handler || !event) {
-- return this;
-- }
--
-- var eventProcessor = this._$eventProcessor;
--
-- if (query != null && eventProcessor && eventProcessor.normalizeQuery) {
-- query = eventProcessor.normalizeQuery(query);
++ let allAborted = true;
++ for (let i = 0; i < tracksKeys.length; i++) {
++ if (!tracks[tracksKeys[i]].isFinished()) {
++ allAborted = false;
++ break;
}
--
-- if (!_h[event]) {
-- _h[event] = [];
++ }
++ if (allAborted) {
++ this._abortedCallback();
++ }
++ return allAborted;
++ }
++ saveFinalToTarget(target, trackKeys) {
++ if (!target) {
++ return;
++ }
++ trackKeys = trackKeys || this._trackKeys;
++ for (let i = 0; i < trackKeys.length; i++) {
++ const propName = trackKeys[i];
++ const track = this._tracks[propName];
++ if (!track || track.isFinished()) {
++ continue;
}
--
-- for (var i = 0; i < _h[event].length; i++) {
-- if (_h[event][i].h === handler) {
-- return this;
++ const kfs = track.keyframes;
++ const lastKf = kfs[kfs.length - 1];
++ if (lastKf) {
++ let val = cloneValue(lastKf.value);
++ if (track.isValueColor) {
++ val = rgba2String(val);
}
++ target[propName] = val;
}
--
-- var wrap = {
-- h: handler,
-- query: query,
-- ctx: context || this,
-- callAtLast: handler.zrEventfulCallAtLast
-- };
-- var lastIndex = _h[event].length - 1;
-- var lastWrap = _h[event][lastIndex];
-- lastWrap && lastWrap.callAtLast ? _h[event].splice(lastIndex, 0, wrap) : _h[event].push(wrap);
-- return this;
-- };
--
-- Eventful.prototype.isSilent = function (eventName) {
-- var _h = this._$handlers;
-- return !_h || !_h[eventName] || !_h[eventName].length;
-- };
--
-- Eventful.prototype.off = function (eventType, handler) {
-- var _h = this._$handlers;
--
-- if (!_h) {
-- return this;
++ }
++ }
++ __changeFinalValue(finalProps, trackKeys) {
++ trackKeys = trackKeys || keys(finalProps);
++ for (let i = 0; i < trackKeys.length; i++) {
++ const propName = trackKeys[i];
++ const track = this._tracks[propName];
++ if (!track) {
++ continue;
}
--
-- if (!eventType) {
-- this._$handlers = {};
-- return this;
++ const kfs = track.keyframes;
++ if (kfs.length > 1) {
++ const lastKf = kfs.pop();
++ track.addKeyframe(lastKf.time, finalProps[propName]);
++ track.prepare(track.getAdditiveTrack());
}
++ }
++ }
++}
-- if (handler) {
-- if (_h[eventType]) {
-- var newList = [];
--
-- for (var i = 0, l = _h[eventType].length; i < l; i++) {
-- if (_h[eventType][i].h !== handler) {
-- newList.push(_h[eventType][i]);
-- }
++// node_modules/zrender/src/core/Point.ts
++class Point4 {
++ constructor(x, y) {
++ this.x = x || 0;
++ this.y = y || 0;
++ }
++ copy(other) {
++ this.x = other.x;
++ this.y = other.y;
++ return this;
++ }
++ clone() {
++ return new Point4(this.x, this.y);
++ }
++ set(x, y) {
++ this.x = x;
++ this.y = y;
++ return this;
++ }
++ equal(other) {
++ return other.x === this.x && other.y === this.y;
++ }
++ add(other) {
++ this.x += other.x;
++ this.y += other.y;
++ return this;
++ }
++ scale(scalar) {
++ this.x *= scalar;
++ this.y *= scalar;
++ }
++ scaleAndAdd(other, scalar) {
++ this.x += other.x * scalar;
++ this.y += other.y * scalar;
++ }
++ sub(other) {
++ this.x -= other.x;
++ this.y -= other.y;
++ return this;
++ }
++ dot(other) {
++ return this.x * other.x + this.y * other.y;
++ }
++ len() {
++ return Math.sqrt(this.x * this.x + this.y * this.y);
++ }
++ lenSquare() {
++ return this.x * this.x + this.y * this.y;
++ }
++ normalize() {
++ const len2 = this.len();
++ this.x /= len2;
++ this.y /= len2;
++ return this;
++ }
++ distance(other) {
++ const dx = this.x - other.x;
++ const dy = this.y - other.y;
++ return Math.sqrt(dx * dx + dy * dy);
++ }
++ distanceSquare(other) {
++ const dx = this.x - other.x;
++ const dy = this.y - other.y;
++ return dx * dx + dy * dy;
++ }
++ negate() {
++ this.x = -this.x;
++ this.y = -this.y;
++ return this;
++ }
++ transform(m2) {
++ if (!m2) {
++ return;
++ }
++ const x = this.x;
++ const y = this.y;
++ this.x = m2[0] * x + m2[2] * y + m2[4];
++ this.y = m2[1] * x + m2[3] * y + m2[5];
++ return this;
++ }
++ toArray(out2) {
++ out2[0] = this.x;
++ out2[1] = this.y;
++ return out2;
++ }
++ fromArray(input) {
++ this.x = input[0];
++ this.y = input[1];
++ }
++ static set(p, x, y) {
++ p.x = x;
++ p.y = y;
++ }
++ static copy(p, p2) {
++ p.x = p2.x;
++ p.y = p2.y;
++ }
++ static len(p) {
++ return Math.sqrt(p.x * p.x + p.y * p.y);
++ }
++ static lenSquare(p) {
++ return p.x * p.x + p.y * p.y;
++ }
++ static dot(p0, p1) {
++ return p0.x * p1.x + p0.y * p1.y;
++ }
++ static add(out2, p0, p1) {
++ out2.x = p0.x + p1.x;
++ out2.y = p0.y + p1.y;
++ }
++ static sub(out2, p0, p1) {
++ out2.x = p0.x - p1.x;
++ out2.y = p0.y - p1.y;
++ }
++ static scale(out2, p0, scalar) {
++ out2.x = p0.x * scalar;
++ out2.y = p0.y * scalar;
++ }
++ static scaleAndAdd(out2, p0, p1, scalar) {
++ out2.x = p0.x + p1.x * scalar;
++ out2.y = p0.y + p1.y * scalar;
++ }
++ static lerp(out2, p0, p1, t) {
++ const onet = 1 - t;
++ out2.x = onet * p0.x + t * p1.x;
++ out2.y = onet * p0.y + t * p1.y;
++ }
++}
++
++// node_modules/zrender/src/core/BoundingRect.ts
++const mathMin = Math.min;
++const mathMax = Math.max;
++const lt = new Point4();
++const rb = new Point4();
++const lb = new Point4();
++const rt = new Point4();
++const minTv = new Point4();
++const maxTv = new Point4();
++class BoundingRect9 {
++ constructor(x, y, width, height) {
++ if (width < 0 && isFinite(width)) {
++ x = x + width;
++ width = -width;
++ }
++ if (height < 0 && isFinite(height)) {
++ y = y + height;
++ height = -height;
++ }
++ this.x = x;
++ this.y = y;
++ this.width = width;
++ this.height = height;
++ }
++ union(other) {
++ const x = mathMin(other.x, this.x);
++ const y = mathMin(other.y, this.y);
++ if (isFinite(this.x) && isFinite(this.width)) {
++ this.width = mathMax(other.x + other.width, this.x + this.width) - x;
++ } else {
++ this.width = other.width;
++ }
++ if (isFinite(this.y) && isFinite(this.height)) {
++ this.height = mathMax(other.y + other.height, this.y + this.height) - y;
++ } else {
++ this.height = other.height;
++ }
++ this.x = x;
++ this.y = y;
++ }
++ applyTransform(m2) {
++ BoundingRect9.applyTransform(this, this, m2);
++ }
++ calculateTransform(b) {
++ const a = this;
++ const sx = b.width / a.width;
++ const sy = b.height / a.height;
++ const m2 = create();
++ translate(m2, m2, [-a.x, -a.y]);
++ scale(m2, m2, [sx, sy]);
++ translate(m2, m2, [b.x, b.y]);
++ return m2;
++ }
++ intersect(b, mtv) {
++ if (!b) {
++ return false;
++ }
++ if (!(b instanceof BoundingRect9)) {
++ b = BoundingRect9.create(b);
++ }
++ const a = this;
++ const ax0 = a.x;
++ const ax1 = a.x + a.width;
++ const ay0 = a.y;
++ const ay1 = a.y + a.height;
++ const bx0 = b.x;
++ const bx1 = b.x + b.width;
++ const by0 = b.y;
++ const by1 = b.y + b.height;
++ let overlap = !(ax1 < bx0 || bx1 < ax0 || ay1 < by0 || by1 < ay0);
++ if (mtv) {
++ let dMin = Infinity;
++ let dMax = 0;
++ const d0 = Math.abs(ax1 - bx0);
++ const d1 = Math.abs(bx1 - ax0);
++ const d2 = Math.abs(ay1 - by0);
++ const d3 = Math.abs(by1 - ay0);
++ const dx = Math.min(d0, d1);
++ const dy = Math.min(d2, d3);
++ if (ax1 < bx0 || bx1 < ax0) {
++ if (dx > dMax) {
++ dMax = dx;
++ if (d0 < d1) {
++ Point4.set(maxTv, -d0, 0);
++ } else {
++ Point4.set(maxTv, d1, 0);
}
--
-- _h[eventType] = newList;
-- }
--
-- if (_h[eventType] && _h[eventType].length === 0) {
-- delete _h[eventType];
}
} else {
-- delete _h[eventType];
-- }
--
-- return this;
-- };
--
-- Eventful.prototype.trigger = function (eventType) {
-- var args = [];
--
-- for (var _i = 1; _i < arguments.length; _i++) {
-- args[_i - 1] = arguments[_i];
-- }
--
-- if (!this._$handlers) {
-- return this;
-- }
--
-- var _h = this._$handlers[eventType];
-- var eventProcessor = this._$eventProcessor;
--
-- if (_h) {
-- var argLen = args.length;
-- var len = _h.length;
--
-- for (var i = 0; i < len; i++) {
-- var hItem = _h[i];
--
-- if (eventProcessor && eventProcessor.filter && hItem.query != null && !eventProcessor.filter(eventType, hItem.query)) {
-- continue;
-- }
--
-- switch (argLen) {
-- case 0:
-- hItem.h.call(hItem.ctx);
-- break;
--
-- case 1:
-- hItem.h.call(hItem.ctx, args[0]);
-- break;
--
-- case 2:
-- hItem.h.call(hItem.ctx, args[0], args[1]);
-- break;
--
-- default:
-- hItem.h.apply(hItem.ctx, args);
-- break;
++ if (dx < dMin) {
++ dMin = dx;
++ if (d0 < d1) {
++ Point4.set(minTv, d0, 0);
++ } else {
++ Point4.set(minTv, -d1, 0);
}
}
}
--
-- eventProcessor && eventProcessor.afterTrigger && eventProcessor.afterTrigger(eventType);
-- return this;
-- };
--
-- Eventful.prototype.triggerWithContext = function (type) {
-- if (!this._$handlers) {
-- return this;
-- }
--
-- var _h = this._$handlers[type];
-- var eventProcessor = this._$eventProcessor;
--
-- if (_h) {
-- var args = arguments;
-- var argLen = args.length;
-- var ctx = args[argLen - 1];
-- var len = _h.length;
--
-- for (var i = 0; i < len; i++) {
-- var hItem = _h[i];
--
-- if (eventProcessor && eventProcessor.filter && hItem.query != null && !eventProcessor.filter(type, hItem.query)) {
-- continue;
++ if (ay1 < by0 || by1 < ay0) {
++ if (dy > dMax) {
++ dMax = dy;
++ if (d2 < d3) {
++ Point4.set(maxTv, 0, -d2);
++ } else {
++ Point4.set(maxTv, 0, d3);
}
--
-- switch (argLen) {
-- case 0:
-- hItem.h.call(ctx);
-- break;
--
-- case 1:
-- hItem.h.call(ctx, args[0]);
-- break;
--
-- case 2:
-- hItem.h.call(ctx, args[0], args[1]);
-- break;
--
-- default:
-- hItem.h.apply(ctx, args.slice(1, argLen - 1));
-- break;
++ }
++ } else {
++ if (dx < dMin) {
++ dMin = dx;
++ if (d2 < d3) {
++ Point4.set(minTv, 0, d2);
++ } else {
++ Point4.set(minTv, 0, -d3);
}
}
}
--
-- eventProcessor && eventProcessor.afterTrigger && eventProcessor.afterTrigger(type);
-- return this;
-- };
--
-- return Eventful;
-- }();
--
-- var LN2 = Math.log(2);
--
-- function determinant(rows, rank, rowStart, rowMask, colMask, detCache) {
-- var cacheKey = rowMask + '-' + colMask;
-- var fullRank = rows.length;
--
-- if (detCache.hasOwnProperty(cacheKey)) {
-- return detCache[cacheKey];
-- }
--
-- if (rank === 1) {
-- var colStart = Math.round(Math.log((1 << fullRank) - 1 & ~colMask) / LN2);
-- return rows[rowStart][colStart];
-- }
--
-- var subRowMask = rowMask | 1 << rowStart;
-- var subRowStart = rowStart + 1;
--
-- while (rowMask & 1 << subRowStart) {
-- subRowStart++;
}
--
-- var sum = 0;
--
-- for (var j = 0, colLocalIdx = 0; j < fullRank; j++) {
-- var colTag = 1 << j;
--
-- if (!(colTag & colMask)) {
-- sum += (colLocalIdx % 2 ? -1 : 1) * rows[rowStart][j] * determinant(rows, rank - 1, subRowStart, subRowMask, colMask | colTag, detCache);
-- colLocalIdx++;
-- }
++ if (mtv) {
++ Point4.copy(mtv, overlap ? minTv : maxTv);
}
--
-- detCache[cacheKey] = sum;
-- return sum;
++ return overlap;
}
--
-- function buildTransformer(src, dest) {
-- var mA = [[src[0], src[1], 1, 0, 0, 0, -dest[0] * src[0], -dest[0] * src[1]], [0, 0, 0, src[0], src[1], 1, -dest[1] * src[0], -dest[1] * src[1]], [src[2], src[3], 1, 0, 0, 0, -dest[2] * src[2], -dest[2] * src[3]], [0, 0, 0, src[2], src[3], 1, -dest[3] * src[2], -dest[3] * src[3]], [src[4], src[5], 1, 0, 0, 0, -dest[4] * src[4], -dest[4] * src[5]], [0, 0, 0, src[4], src[5], 1, -dest[5] * src[4], -dest[5] * src[5]], [src[6], src[7], 1, 0, 0, 0, -dest[6] * src[6], -dest[6] * src[7]], [ [...]
-- var detCache = {};
-- var det = determinant(mA, 8, 0, 0, 0, detCache);
--
-- if (det === 0) {
++ contain(x, y) {
++ const rect = this;
++ return x >= rect.x && x <= rect.x + rect.width && y >= rect.y && y <= rect.y + rect.height;
++ }
++ clone() {
++ return new BoundingRect9(this.x, this.y, this.width, this.height);
++ }
++ copy(other) {
++ BoundingRect9.copy(this, other);
++ }
++ plain() {
++ return {
++ x: this.x,
++ y: this.y,
++ width: this.width,
++ height: this.height
++ };
++ }
++ isFinite() {
++ return isFinite(this.x) && isFinite(this.y) && isFinite(this.width) && isFinite(this.height);
++ }
++ isZero() {
++ return this.width === 0 || this.height === 0;
++ }
++ static create(rect) {
++ return new BoundingRect9(rect.x, rect.y, rect.width, rect.height);
++ }
++ static copy(target, source) {
++ target.x = source.x;
++ target.y = source.y;
++ target.width = source.width;
++ target.height = source.height;
++ }
++ static applyTransform(target, source, m2) {
++ if (!m2) {
++ if (target !== source) {
++ BoundingRect9.copy(target, source);
++ }
return;
}
--
-- var vh = [];
--
-- for (var i = 0; i < 8; i++) {
-- for (var j = 0; j < 8; j++) {
-- vh[j] == null && (vh[j] = 0);
-- vh[j] += ((i + j) % 2 ? -1 : 1) * determinant(mA, 7, i === 0 ? 1 : 0, 1 << i, 1 << j, detCache) / det * dest[i];
++ if (m2[1] < 1e-5 && m2[1] > -1e-5 && m2[2] < 1e-5 && m2[2] > -1e-5) {
++ const sx = m2[0];
++ const sy = m2[3];
++ const tx = m2[4];
++ const ty = m2[5];
++ target.x = source.x * sx + tx;
++ target.y = source.y * sy + ty;
++ target.width = source.width * sx;
++ target.height = source.height * sy;
++ if (target.width < 0) {
++ target.x += target.width;
++ target.width = -target.width;
++ }
++ if (target.height < 0) {
++ target.y += target.height;
++ target.height = -target.height;
}
++ return;
}
--
-- return function (out, srcPointX, srcPointY) {
-- var pk = srcPointX * vh[6] + srcPointY * vh[7] + 1;
-- out[0] = (srcPointX * vh[0] + srcPointY * vh[1] + vh[2]) / pk;
-- out[1] = (srcPointX * vh[3] + srcPointY * vh[4] + vh[5]) / pk;
-- };
-- }
--
-- var EVENT_SAVED_PROP = '___zrEVENTSAVED';
-- var _calcOut = [];
--
-- function transformLocalCoord(out, elFrom, elTarget, inX, inY) {
-- return transformCoordWithViewport(_calcOut, elFrom, inX, inY, true) && transformCoordWithViewport(out, elTarget, _calcOut[0], _calcOut[1]);
-- }
--
-- function transformCoordWithViewport(out, el, inX, inY, inverse) {
-- if (el.getBoundingClientRect && env.domSupported && !isCanvasEl(el)) {
-- var saved = el[EVENT_SAVED_PROP] || (el[EVENT_SAVED_PROP] = {});
-- var markers = prepareCoordMarkers(el, saved);
-- var transformer = preparePointerTransformer(markers, saved, inverse);
--
-- if (transformer) {
-- transformer(out, inX, inY);
-- return true;
-- }
++ lt.x = lb.x = source.x;
++ lt.y = rt.y = source.y;
++ rb.x = rt.x = source.x + source.width;
++ rb.y = lb.y = source.y + source.height;
++ lt.transform(m2);
++ rt.transform(m2);
++ rb.transform(m2);
++ lb.transform(m2);
++ target.x = mathMin(lt.x, rb.x, lb.x, rt.x);
++ target.y = mathMin(lt.y, rb.y, lb.y, rt.y);
++ const maxX = mathMax(lt.x, rb.x, lb.x, rt.x);
++ const maxY = mathMax(lt.y, rb.y, lb.y, rt.y);
++ target.width = maxX - target.x;
++ target.height = maxY - target.y;
++ }
++}
++const BoundingRect_default = BoundingRect9;
++
++// node_modules/zrender/src/contain/text.ts
++let textWidthCache = {};
++const DEFAULT_FONT = "12px sans-serif";
++let _ctx;
++let _cachedFont;
++function defaultMeasureText(text12, font) {
++ if (!_ctx) {
++ _ctx = createCanvas().getContext("2d");
++ }
++ if (_cachedFont !== font) {
++ _cachedFont = _ctx.font = font || DEFAULT_FONT;
++ }
++ return _ctx.measureText(text12);
++}
++let methods = {
++ measureText: defaultMeasureText
++};
++function getWidth(text12, font) {
++ font = font || DEFAULT_FONT;
++ let cacheOfFont = textWidthCache[font];
++ if (!cacheOfFont) {
++ cacheOfFont = textWidthCache[font] = new LRU2(500);
++ }
++ let width = cacheOfFont.get(text12);
++ if (width == null) {
++ width = methods.measureText(text12, font).width;
++ cacheOfFont.put(text12, width);
++ }
++ return width;
++}
++function innerGetBoundingRect(text12, font, textAlign, textBaseline) {
++ const width = getWidth(text12, font);
++ const height = getLineHeight(font);
++ const x = adjustTextX(0, width, textAlign);
++ const y = adjustTextY(0, height, textBaseline);
++ const rect = new BoundingRect_default(x, y, width, height);
++ return rect;
++}
++function getBoundingRect(text12, font, textAlign, textBaseline) {
++ const textLines = ((text12 || "") + "").split("\n");
++ const len2 = textLines.length;
++ if (len2 === 1) {
++ return innerGetBoundingRect(textLines[0], font, textAlign, textBaseline);
++ } else {
++ const uniondRect = new BoundingRect_default(0, 0, 0, 0);
++ for (let i = 0; i < textLines.length; i++) {
++ const rect = innerGetBoundingRect(textLines[i], font, textAlign, textBaseline);
++ i === 0 ? uniondRect.copy(rect) : uniondRect.union(rect);
++ }
++ return uniondRect;
++ }
++}
++function adjustTextX(x, width, textAlign) {
++ if (textAlign === "right") {
++ x -= width;
++ } else if (textAlign === "center") {
++ x -= width / 2;
++ }
++ return x;
++}
++function adjustTextY(y, height, verticalAlign) {
++ if (verticalAlign === "middle") {
++ y -= height / 2;
++ } else if (verticalAlign === "bottom") {
++ y -= height;
++ }
++ return y;
++}
++function getLineHeight(font) {
++ return getWidth("国", font);
++}
++function parsePercent(value, maxValue) {
++ if (typeof value === "string") {
++ if (value.lastIndexOf("%") >= 0) {
++ return parseFloat(value) / 100 * maxValue;
++ }
++ return parseFloat(value);
++ }
++ return value;
++}
++function calculateTextPosition(out2, opts, rect) {
++ const textPosition = opts.position || "inside";
++ const distance2 = opts.distance != null ? opts.distance : 5;
++ const height = rect.height;
++ const width = rect.width;
++ const halfHeight = height / 2;
++ let x = rect.x;
++ let y = rect.y;
++ let textAlign = "left";
++ let textVerticalAlign = "top";
++ if (textPosition instanceof Array) {
++ x += parsePercent(textPosition[0], rect.width);
++ y += parsePercent(textPosition[1], rect.height);
++ textAlign = null;
++ textVerticalAlign = null;
++ } else {
++ switch (textPosition) {
++ case "left":
++ x -= distance2;
++ y += halfHeight;
++ textAlign = "right";
++ textVerticalAlign = "middle";
++ break;
++ case "right":
++ x += distance2 + width;
++ y += halfHeight;
++ textVerticalAlign = "middle";
++ break;
++ case "top":
++ x += width / 2;
++ y -= distance2;
++ textAlign = "center";
++ textVerticalAlign = "bottom";
++ break;
++ case "bottom":
++ x += width / 2;
++ y += height + distance2;
++ textAlign = "center";
++ break;
++ case "inside":
++ x += width / 2;
++ y += halfHeight;
++ textAlign = "center";
++ textVerticalAlign = "middle";
++ break;
++ case "insideLeft":
++ x += distance2;
++ y += halfHeight;
++ textVerticalAlign = "middle";
++ break;
++ case "insideRight":
++ x += width - distance2;
++ y += halfHeight;
++ textAlign = "right";
++ textVerticalAlign = "middle";
++ break;
++ case "insideTop":
++ x += width / 2;
++ y += distance2;
++ textAlign = "center";
++ break;
++ case "insideBottom":
++ x += width / 2;
++ y += height - distance2;
++ textAlign = "center";
++ textVerticalAlign = "bottom";
++ break;
++ case "insideTopLeft":
++ x += distance2;
++ y += distance2;
++ break;
++ case "insideTopRight":
++ x += width - distance2;
++ y += distance2;
++ textAlign = "right";
++ break;
++ case "insideBottomLeft":
++ x += distance2;
++ y += height - distance2;
++ textVerticalAlign = "bottom";
++ break;
++ case "insideBottomRight":
++ x += width - distance2;
++ y += height - distance2;
++ textAlign = "right";
++ textVerticalAlign = "bottom";
++ break;
}
--
-- return false;
}
--
-- function prepareCoordMarkers(el, saved) {
-- var markers = saved.markers;
--
-- if (markers) {
-- return markers;
++ out2 = out2 || {};
++ out2.x = x;
++ out2.y = y;
++ out2.align = textAlign;
++ out2.verticalAlign = textVerticalAlign;
++ return out2;
++}
++
++// node_modules/zrender/src/config.ts
++let dpr = 1;
++if (typeof window !== "undefined") {
++ dpr = Math.max(window.devicePixelRatio || window.screen.deviceXDPI / window.screen.logicalXDPI || 1, 1);
++}
++const devicePixelRatio = dpr;
++const DARK_MODE_THRESHOLD = 0.4;
++const DARK_LABEL_COLOR = "#333";
++const LIGHT_LABEL_COLOR = "#ccc";
++const LIGHTER_LABEL_COLOR = "#eee";
++
++// node_modules/zrender/src/Element.ts
++const PRESERVED_NORMAL_STATE = "__zr_normal__";
++const PRIMARY_STATES_KEYS = ["x", "y", "scaleX", "scaleY", "originX", "originY", "rotation", "ignore"];
++const DEFAULT_ANIMATABLE_MAP = {
++ x: true,
++ y: true,
++ scaleX: true,
++ scaleY: true,
++ originX: true,
++ originY: true,
++ rotation: true,
++ ignore: false
++};
++let tmpTextPosCalcRes = {};
++let tmpBoundingRect = new BoundingRect_default(0, 0, 0, 0);
++class Element {
++ constructor(props) {
++ this.id = guid();
++ this.animators = [];
++ this.currentStates = [];
++ this.states = {};
++ this._init(props);
++ }
++ _init(props) {
++ this.attr(props);
++ }
++ drift(dx, dy, e2) {
++ switch (this.draggable) {
++ case "horizontal":
++ dy = 0;
++ break;
++ case "vertical":
++ dx = 0;
++ break;
}
--
-- markers = saved.markers = [];
-- var propLR = ['left', 'right'];
-- var propTB = ['top', 'bottom'];
--
-- for (var i = 0; i < 4; i++) {
-- var marker = document.createElement('div');
-- var stl = marker.style;
-- var idxLR = i % 2;
-- var idxTB = (i >> 1) % 2;
-- stl.cssText = ['position: absolute', 'visibility: hidden', 'padding: 0', 'margin: 0', 'border-width: 0', 'user-select: none', 'width:0', 'height:0', propLR[idxLR] + ':0', propTB[idxTB] + ':0', propLR[1 - idxLR] + ':auto', propTB[1 - idxTB] + ':auto', ''].join('!important;');
-- el.appendChild(marker);
-- markers.push(marker);
++ let m2 = this.transform;
++ if (!m2) {
++ m2 = this.transform = [1, 0, 0, 1, 0, 0];
}
--
-- return markers;
++ m2[4] += dx;
++ m2[5] += dy;
++ this.decomposeTransform();
++ this.markRedraw();
}
--
-- function preparePointerTransformer(markers, saved, inverse) {
-- var transformerName = inverse ? 'invTrans' : 'trans';
-- var transformer = saved[transformerName];
-- var oldSrcCoords = saved.srcCoords;
-- var srcCoords = [];
-- var destCoords = [];
-- var oldCoordTheSame = true;
--
-- for (var i = 0; i < 4; i++) {
-- var rect = markers[i].getBoundingClientRect();
-- var ii = 2 * i;
-- var x = rect.left;
-- var y = rect.top;
-- srcCoords.push(x, y);
-- oldCoordTheSame = oldCoordTheSame && oldSrcCoords && x === oldSrcCoords[ii] && y === oldSrcCoords[ii + 1];
-- destCoords.push(markers[i].offsetLeft, markers[i].offsetTop);
-- }
--
-- return oldCoordTheSame && transformer ? transformer : (saved.srcCoords = srcCoords, saved[transformerName] = inverse ? buildTransformer(destCoords, srcCoords) : buildTransformer(srcCoords, destCoords));
++ beforeUpdate() {
}
--
-- function isCanvasEl(el) {
-- return el.nodeName.toUpperCase() === 'CANVAS';
++ afterUpdate() {
}
--
-- var isDomLevel2 = typeof window !== 'undefined' && !!window.addEventListener;
-- var MOUSE_EVENT_REG = /^(?:mouse|pointer|contextmenu|drag|drop)|click/;
-- var _calcOut$1 = [];
--
-- function clientToLocal(el, e, out, calculate) {
-- out = out || {};
--
-- if (calculate || !env.canvasSupported) {
-- calculateZrXY(el, e, out);
-- } else if (env.browser.firefox && e.layerX != null && e.layerX !== e.offsetX) {
-- out.zrX = e.layerX;
-- out.zrY = e.layerY;
-- } else if (e.offsetX != null) {
-- out.zrX = e.offsetX;
-- out.zrY = e.offsetY;
-- } else {
-- calculateZrXY(el, e, out);
++ update() {
++ this.updateTransform();
++ if (this.__dirty) {
++ this.updateInnerText();
}
--
-- return out;
}
--
-- function calculateZrXY(el, e, out) {
-- if (env.domSupported && el.getBoundingClientRect) {
-- var ex = e.clientX;
-- var ey = e.clientY;
--
-- if (isCanvasEl(el)) {
-- var box = el.getBoundingClientRect();
-- out.zrX = ex - box.left;
-- out.zrY = ey - box.top;
-- return;
++ updateInnerText(forceUpdate) {
++ const textEl = this._textContent;
++ if (textEl && (!textEl.ignore || forceUpdate)) {
++ if (!this.textConfig) {
++ this.textConfig = {};
++ }
++ const textConfig = this.textConfig;
++ const isLocal = textConfig.local;
++ const attachedTransform = textEl.attachedTransform;
++ let textAlign;
++ let textVerticalAlign;
++ let textStyleChanged = false;
++ if (isLocal) {
++ attachedTransform.parent = this;
} else {
-- if (transformCoordWithViewport(_calcOut$1, el, ex, ey)) {
-- out.zrX = _calcOut$1[0];
-- out.zrY = _calcOut$1[1];
-- return;
++ attachedTransform.parent = null;
++ }
++ let innerOrigin = false;
++ attachedTransform.x = textEl.x;
++ attachedTransform.y = textEl.y;
++ attachedTransform.originX = textEl.originX;
++ attachedTransform.originY = textEl.originY;
++ attachedTransform.rotation = textEl.rotation;
++ attachedTransform.scaleX = textEl.scaleX;
++ attachedTransform.scaleY = textEl.scaleY;
++ if (textConfig.position != null) {
++ let layoutRect = tmpBoundingRect;
++ if (textConfig.layoutRect) {
++ layoutRect.copy(textConfig.layoutRect);
++ } else {
++ layoutRect.copy(this.getBoundingRect());
++ }
++ if (!isLocal) {
++ layoutRect.applyTransform(this.transform);
++ }
++ if (this.calculateTextPosition) {
++ this.calculateTextPosition(tmpTextPosCalcRes, textConfig, layoutRect);
++ } else {
++ calculateTextPosition(tmpTextPosCalcRes, textConfig, layoutRect);
++ }
++ attachedTransform.x = tmpTextPosCalcRes.x;
++ attachedTransform.y = tmpTextPosCalcRes.y;
++ textAlign = tmpTextPosCalcRes.align;
++ textVerticalAlign = tmpTextPosCalcRes.verticalAlign;
++ const textOrigin = textConfig.origin;
++ if (textOrigin && textConfig.rotation != null) {
++ let relOriginX;
++ let relOriginY;
++ if (textOrigin === "center") {
++ relOriginX = layoutRect.width * 0.5;
++ relOriginY = layoutRect.height * 0.5;
++ } else {
++ relOriginX = parsePercent(textOrigin[0], layoutRect.width);
++ relOriginY = parsePercent(textOrigin[1], layoutRect.height);
++ }
++ innerOrigin = true;
++ attachedTransform.originX = -attachedTransform.x + relOriginX + (isLocal ? 0 : layoutRect.x);
++ attachedTransform.originY = -attachedTransform.y + relOriginY + (isLocal ? 0 : layoutRect.y);
++ }
++ }
++ if (textConfig.rotation != null) {
++ attachedTransform.rotation = textConfig.rotation;
++ }
++ const textOffset = textConfig.offset;
++ if (textOffset) {
++ attachedTransform.x += textOffset[0];
++ attachedTransform.y += textOffset[1];
++ if (!innerOrigin) {
++ attachedTransform.originX = -textOffset[0];
++ attachedTransform.originY = -textOffset[1];
++ }
++ }
++ const isInside = textConfig.inside == null ? typeof textConfig.position === "string" && textConfig.position.indexOf("inside") >= 0 : textConfig.inside;
++ const innerTextDefaultStyle = this._innerTextDefaultStyle || (this._innerTextDefaultStyle = {});
++ let textFill;
++ let textStroke;
++ let autoStroke;
++ if (isInside && this.canBeInsideText()) {
++ textFill = textConfig.insideFill;
++ textStroke = textConfig.insideStroke;
++ if (textFill == null || textFill === "auto") {
++ textFill = this.getInsideTextFill();
++ }
++ if (textStroke == null || textStroke === "auto") {
++ textStroke = this.getInsideTextStroke(textFill);
++ autoStroke = true;
+ }
++ } else {
++ textFill = textConfig.outsideFill;
++ textStroke = textConfig.outsideStroke;
++ if (textFill == null || textFill === "auto") {
++ textFill = this.getOutsideFill();
+ }
++ if (textStroke == null || textStroke === "auto") {
++ textStroke = this.getOutsideStroke(textFill);
++ autoStroke = true;
++ }
++ }
++ textFill = textFill || "#000";
++ if (textFill !== innerTextDefaultStyle.fill || textStroke !== innerTextDefaultStyle.stroke || autoStroke !== innerTextDefaultStyle.autoStroke || textAlign !== innerTextDefaultStyle.align || textVerticalAlign !== innerTextDefaultStyle.verticalAlign) {
++ textStyleChanged = true;
++ innerTextDefaultStyle.fill = textFill;
++ innerTextDefaultStyle.stroke = textStroke;
++ innerTextDefaultStyle.autoStroke = autoStroke;
++ innerTextDefaultStyle.align = textAlign;
++ innerTextDefaultStyle.verticalAlign = textVerticalAlign;
++ textEl.setDefaultTextStyle(innerTextDefaultStyle);
}
++ if (textStyleChanged) {
++ textEl.dirtyStyle();
++ }
++ textEl.markRedraw();
}
--
-- out.zrX = out.zrY = 0;
}
--
-- function getNativeEvent(e) {
-- return e || window.event;
++ canBeInsideText() {
++ return true;
}
--
-- function normalizeEvent(el, e, calculate) {
-- e = getNativeEvent(e);
--
-- if (e.zrX != null) {
-- return e;
-- }
--
-- var eventType = e.type;
-- var isTouch = eventType && eventType.indexOf('touch') >= 0;
--
-- if (!isTouch) {
-- clientToLocal(el, e, e, calculate);
-- var wheelDelta = getWheelDeltaMayPolyfill(e);
-- e.zrDelta = wheelDelta ? wheelDelta / 120 : -(e.detail || 0) / 3;
++ getInsideTextFill() {
++ return "#fff";
++ }
++ getInsideTextStroke(textFill) {
++ return "#000";
++ }
++ getOutsideFill() {
++ return this.__zr && this.__zr.isDarkMode() ? LIGHT_LABEL_COLOR : DARK_LABEL_COLOR;
++ }
++ getOutsideStroke(textFill) {
++ const backgroundColor2 = this.__zr && this.__zr.getBackgroundColor();
++ let colorArr = typeof backgroundColor2 === "string" && parse(backgroundColor2);
++ if (!colorArr) {
++ colorArr = [255, 255, 255, 1];
++ }
++ const alpha = colorArr[3];
++ const isDark = this.__zr.isDarkMode();
++ for (let i = 0; i < 3; i++) {
++ colorArr[i] = colorArr[i] * alpha + (isDark ? 0 : 255) * (1 - alpha);
++ }
++ colorArr[3] = 1;
++ return stringify(colorArr, "rgba");
++ }
++ traverse(cb, context) {
++ }
++ attrKV(key, value) {
++ if (key === "textConfig") {
++ this.setTextConfig(value);
++ } else if (key === "textContent") {
++ this.setTextContent(value);
++ } else if (key === "clipPath") {
++ this.setClipPath(value);
++ } else if (key === "extra") {
++ this.extra = this.extra || {};
++ extend(this.extra, value);
} else {
-- var touch = eventType !== 'touchend' ? e.targetTouches[0] : e.changedTouches[0];
-- touch && clientToLocal(el, touch, e, calculate);
-- }
--
-- var button = e.button;
--
-- if (e.which == null && button !== undefined && MOUSE_EVENT_REG.test(e.type)) {
-- e.which = button & 1 ? 1 : button & 2 ? 3 : button & 4 ? 2 : 0;
++ this[key] = value;
++ }
++ }
++ hide() {
++ this.ignore = true;
++ this.markRedraw();
++ }
++ show() {
++ this.ignore = false;
++ this.markRedraw();
++ }
++ attr(keyOrObj, value) {
++ if (typeof keyOrObj === "string") {
++ this.attrKV(keyOrObj, value);
++ } else if (isObject(keyOrObj)) {
++ let obj = keyOrObj;
++ let keysArr = keys(obj);
++ for (let i = 0; i < keysArr.length; i++) {
++ let key = keysArr[i];
++ this.attrKV(key, keyOrObj[key]);
++ }
++ }
++ this.markRedraw();
++ return this;
++ }
++ saveCurrentToNormalState(toState) {
++ this._innerSaveToNormal(toState);
++ const normalState = this._normalState;
++ for (let i = 0; i < this.animators.length; i++) {
++ const animator = this.animators[i];
++ const fromStateTransition = animator.__fromStateTransition;
++ if (fromStateTransition && fromStateTransition !== PRESERVED_NORMAL_STATE) {
++ continue;
++ }
++ const targetName = animator.targetName;
++ const target = targetName ? normalState[targetName] : normalState;
++ animator.saveFinalToTarget(target);
}
--
-- return e;
}
--
-- function getWheelDeltaMayPolyfill(e) {
-- var rawWheelDelta = e.wheelDelta;
--
-- if (rawWheelDelta) {
-- return rawWheelDelta;
++ _innerSaveToNormal(toState) {
++ let normalState = this._normalState;
++ if (!normalState) {
++ normalState = this._normalState = {};
}
--
-- var deltaX = e.deltaX;
-- var deltaY = e.deltaY;
--
-- if (deltaX == null || deltaY == null) {
-- return rawWheelDelta;
++ if (toState.textConfig && !normalState.textConfig) {
++ normalState.textConfig = this.textConfig;
}
--
-- var delta = deltaY !== 0 ? Math.abs(deltaY) : Math.abs(deltaX);
-- var sign = deltaY > 0 ? -1 : deltaY < 0 ? 1 : deltaX > 0 ? -1 : 1;
-- return 3 * delta * sign;
++ this._savePrimaryToNormal(toState, normalState, PRIMARY_STATES_KEYS);
}
--
-- function addEventListener(el, name, handler, opt) {
-- if (isDomLevel2) {
-- el.addEventListener(name, handler, opt);
-- } else {
-- el.attachEvent('on' + name, handler);
++ _savePrimaryToNormal(toState, normalState, primaryKeys) {
++ for (let i = 0; i < primaryKeys.length; i++) {
++ let key = primaryKeys[i];
++ if (toState[key] != null && !(key in normalState)) {
++ normalState[key] = this[key];
++ }
}
}
--
-- function removeEventListener(el, name, handler, opt) {
-- if (isDomLevel2) {
-- el.removeEventListener(name, handler, opt);
-- } else {
-- el.detachEvent('on' + name, handler);
-- }
++ hasState() {
++ return this.currentStates.length > 0;
}
--
-- var stop = isDomLevel2 ? function (e) {
-- e.preventDefault();
-- e.stopPropagation();
-- e.cancelBubble = true;
-- } : function (e) {
-- e.returnValue = false;
-- e.cancelBubble = true;
-- };
--
-- function isMiddleOrRightButtonOnMouseUpDown(e) {
-- return e.which === 2 || e.which === 3;
++ getState(name2) {
++ return this.states[name2];
}
--
-- var GestureMgr = function () {
-- function GestureMgr() {
-- this._track = [];
++ ensureState(name2) {
++ const states36 = this.states;
++ if (!states36[name2]) {
++ states36[name2] = {};
}
--
-- GestureMgr.prototype.recognize = function (event, target, root) {
-- this._doTrack(event, target, root);
--
-- return this._recognize(event);
-- };
--
-- GestureMgr.prototype.clear = function () {
-- this._track.length = 0;
-- return this;
-- };
--
-- GestureMgr.prototype._doTrack = function (event, target, root) {
-- var touches = event.touches;
--
-- if (!touches) {
-- return;
-- }
--
-- var trackItem = {
-- points: [],
-- touches: [],
-- target: target,
-- event: event
-- };
--
-- for (var i = 0, len = touches.length; i < len; i++) {
-- var touch = touches[i];
-- var pos = clientToLocal(root, touch, {});
-- trackItem.points.push([pos.zrX, pos.zrY]);
-- trackItem.touches.push(touch);
-- }
--
-- this._track.push(trackItem);
-- };
--
-- GestureMgr.prototype._recognize = function (event) {
-- for (var eventName in recognizers) {
-- if (recognizers.hasOwnProperty(eventName)) {
-- var gestureInfo = recognizers[eventName](this._track, event);
--
-- if (gestureInfo) {
-- return gestureInfo;
-- }
-- }
-- }
-- };
--
-- return GestureMgr;
-- }();
--
-- function dist$1(pointPair) {
-- var dx = pointPair[1][0] - pointPair[0][0];
-- var dy = pointPair[1][1] - pointPair[0][1];
-- return Math.sqrt(dx * dx + dy * dy);
++ return states36[name2];
}
--
-- function center(pointPair) {
-- return [(pointPair[0][0] + pointPair[1][0]) / 2, (pointPair[0][1] + pointPair[1][1]) / 2];
++ clearStates(noAnimation) {
++ this.useState(PRESERVED_NORMAL_STATE, false, noAnimation);
}
--
-- var recognizers = {
-- pinch: function (tracks, event) {
-- var trackLen = tracks.length;
--
-- if (!trackLen) {
-- return;
-- }
--
-- var pinchEnd = (tracks[trackLen - 1] || {}).points;
-- var pinchPre = (tracks[trackLen - 2] || {}).points || pinchEnd;
--
-- if (pinchPre && pinchPre.length > 1 && pinchEnd && pinchEnd.length > 1) {
-- var pinchScale = dist$1(pinchEnd) / dist$1(pinchPre);
-- !isFinite(pinchScale) && (pinchScale = 1);
-- event.pinchScale = pinchScale;
-- var pinchCenter = center(pinchEnd);
-- event.pinchX = pinchCenter[0];
-- event.pinchY = pinchCenter[1];
-- return {
-- type: 'pinch',
-- target: tracks[0].target,
-- event: event
-- };
-- }
++ useState(stateName, keepCurrentStates, noAnimation) {
++ const toNormalState = stateName === PRESERVED_NORMAL_STATE;
++ const hasStates = this.hasState();
++ if (!hasStates && toNormalState) {
++ return;
}
-- };
-- var SILENT = 'silent';
--
-- function makeEventPacket(eveType, targetInfo, event) {
-- return {
-- type: eveType,
-- event: event,
-- target: targetInfo.target,
-- topTarget: targetInfo.topTarget,
-- cancelBubble: false,
-- offsetX: event.zrX,
-- offsetY: event.zrY,
-- gestureEvent: event.gestureEvent,
-- pinchX: event.pinchX,
-- pinchY: event.pinchY,
-- pinchScale: event.pinchScale,
-- wheelDelta: event.zrDelta,
-- zrByTouch: event.zrByTouch,
-- which: event.which,
-- stop: stopEvent
-- };
-- }
--
-- function stopEvent() {
-- stop(this.event);
-- }
--
-- var EmptyProxy = function (_super) {
-- __extends(EmptyProxy, _super);
--
-- function EmptyProxy() {
-- var _this = _super !== null && _super.apply(this, arguments) || this;
--
-- _this.handler = null;
-- return _this;
++ const currentStates = this.currentStates;
++ const animationCfg = this.stateTransition;
++ if (indexOf(currentStates, stateName) >= 0 && (keepCurrentStates || currentStates.length === 1)) {
++ return;
}
--
-- EmptyProxy.prototype.dispose = function () {};
--
-- EmptyProxy.prototype.setCursor = function () {};
--
-- return EmptyProxy;
-- }(Eventful);
--
-- var HoveredResult = function () {
-- function HoveredResult(x, y) {
-- this.x = x;
-- this.y = y;
++ let state;
++ if (this.stateProxy && !toNormalState) {
++ state = this.stateProxy(stateName);
}
--
-- return HoveredResult;
-- }();
--
-- var handlerNames = ['click', 'dblclick', 'mousewheel', 'mouseout', 'mouseup', 'mousedown', 'mousemove', 'contextmenu'];
--
-- var Handler = function (_super) {
-- __extends(Handler, _super);
--
-- function Handler(storage, painter, proxy, painterRoot) {
-- var _this = _super.call(this) || this;
--
-- _this._hovered = new HoveredResult(0, 0);
-- _this.storage = storage;
-- _this.painter = painter;
-- _this.painterRoot = painterRoot;
-- proxy = proxy || new EmptyProxy();
-- _this.proxy = null;
--
-- _this.setHandlerProxy(proxy);
--
-- _this._draggingMgr = new Draggable(_this);
-- return _this;
++ if (!state) {
++ state = this.states && this.states[stateName];
}
--
-- Handler.prototype.setHandlerProxy = function (proxy) {
-- if (this.proxy) {
-- this.proxy.dispose();
++ if (!state && !toNormalState) {
++ logError(`State ${stateName} not exists.`);
++ return;
++ }
++ if (!toNormalState) {
++ this.saveCurrentToNormalState(state);
++ }
++ const useHoverLayer = !!(state && state.hoverLayer);
++ if (useHoverLayer) {
++ this._toggleHoverLayerFlag(true);
++ }
++ this._applyStateObj(stateName, state, this._normalState, keepCurrentStates, !noAnimation && !this.__inHover && animationCfg && animationCfg.duration > 0, animationCfg);
++ if (this._textContent) {
++ this._textContent.useState(stateName, keepCurrentStates);
++ }
++ if (this._textGuide) {
++ this._textGuide.useState(stateName, keepCurrentStates);
++ }
++ if (toNormalState) {
++ this.currentStates = [];
++ this._normalState = {};
++ } else {
++ if (!keepCurrentStates) {
++ this.currentStates = [stateName];
++ } else {
++ this.currentStates.push(stateName);
}
--
-- if (proxy) {
-- each(handlerNames, function (name) {
-- proxy.on && proxy.on(name, this[name], this);
-- }, this);
-- proxy.handler = this;
++ }
++ this._updateAnimationTargets();
++ this.markRedraw();
++ if (!useHoverLayer && this.__inHover) {
++ this._toggleHoverLayerFlag(false);
++ this.__dirty &= ~Element.REDARAW_BIT;
++ }
++ return state;
++ }
++ useStates(states36, noAnimation) {
++ if (!states36.length) {
++ this.clearStates();
++ } else {
++ const stateObjects = [];
++ const currentStates = this.currentStates;
++ const len2 = states36.length;
++ let notChange = len2 === currentStates.length;
++ if (notChange) {
++ for (let i = 0; i < len2; i++) {
++ if (states36[i] !== currentStates[i]) {
++ notChange = false;
++ break;
++ }
++ }
}
--
-- this.proxy = proxy;
-- };
--
-- Handler.prototype.mousemove = function (event) {
-- var x = event.zrX;
-- var y = event.zrY;
-- var isOutside = isOutsideBoundary(this, x, y);
-- var lastHovered = this._hovered;
-- var lastHoveredTarget = lastHovered.target;
--
-- if (lastHoveredTarget && !lastHoveredTarget.__zr) {
-- lastHovered = this.findHover(lastHovered.x, lastHovered.y);
-- lastHoveredTarget = lastHovered.target;
++ if (notChange) {
++ return;
}
--
-- var hovered = this._hovered = isOutside ? new HoveredResult(x, y) : this.findHover(x, y);
-- var hoveredTarget = hovered.target;
-- var proxy = this.proxy;
-- proxy.setCursor && proxy.setCursor(hoveredTarget ? hoveredTarget.cursor : 'default');
--
-- if (lastHoveredTarget && hoveredTarget !== lastHoveredTarget) {
-- this.dispatchToElement(lastHovered, 'mouseout', event);
++ for (let i = 0; i < len2; i++) {
++ const stateName = states36[i];
++ let stateObj;
++ if (this.stateProxy) {
++ stateObj = this.stateProxy(stateName, states36);
++ }
++ if (!stateObj) {
++ stateObj = this.states[stateName];
++ }
++ if (stateObj) {
++ stateObjects.push(stateObj);
++ }
}
--
-- this.dispatchToElement(hovered, 'mousemove', event);
--
-- if (hoveredTarget && hoveredTarget !== lastHoveredTarget) {
-- this.dispatchToElement(hovered, 'mouseover', event);
++ const useHoverLayer = !!(stateObjects[len2 - 1] && stateObjects[len2 - 1].hoverLayer);
++ if (useHoverLayer) {
++ this._toggleHoverLayerFlag(true);
}
-- };
--
-- Handler.prototype.mouseout = function (event) {
-- var eventControl = event.zrEventControl;
-- var zrIsToLocalDOM = event.zrIsToLocalDOM;
--
-- if (eventControl !== 'only_globalout') {
-- this.dispatchToElement(this._hovered, 'mouseout', event);
++ const mergedState = this._mergeStates(stateObjects);
++ const animationCfg = this.stateTransition;
++ this.saveCurrentToNormalState(mergedState);
++ this._applyStateObj(states36.join(","), mergedState, this._normalState, false, !noAnimation && !this.__inHover && animationCfg && animationCfg.duration > 0, animationCfg);
++ if (this._textContent) {
++ this._textContent.useStates(states36);
}
--
-- if (eventControl !== 'no_globalout') {
-- !zrIsToLocalDOM && this.trigger('globalout', {
-- type: 'globalout',
-- event: event
-- });
++ if (this._textGuide) {
++ this._textGuide.useStates(states36);
}
-- };
--
-- Handler.prototype.resize = function () {
-- this._hovered = new HoveredResult(0, 0);
-- };
--
-- Handler.prototype.dispatch = function (eventName, eventArgs) {
-- var handler = this[eventName];
-- handler && handler.call(this, eventArgs);
-- };
--
-- Handler.prototype.dispose = function () {
-- this.proxy.dispose();
-- this.storage = null;
-- this.proxy = null;
-- this.painter = null;
-- };
--
-- Handler.prototype.setCursorStyle = function (cursorStyle) {
-- var proxy = this.proxy;
-- proxy.setCursor && proxy.setCursor(cursorStyle);
-- };
--
-- Handler.prototype.dispatchToElement = function (targetInfo, eventName, event) {
-- targetInfo = targetInfo || {};
-- var el = targetInfo.target;
--
-- if (el && el.silent) {
-- return;
++ this._updateAnimationTargets();
++ this.currentStates = states36.slice();
++ this.markRedraw();
++ if (!useHoverLayer && this.__inHover) {
++ this._toggleHoverLayerFlag(false);
++ this.__dirty &= ~Element.REDARAW_BIT;
}
--
-- var eventKey = 'on' + eventName;
-- var eventPacket = makeEventPacket(eventName, targetInfo, event);
--
-- while (el) {
-- el[eventKey] && (eventPacket.cancelBubble = !!el[eventKey].call(el, eventPacket));
-- el.trigger(eventName, eventPacket);
-- el = el.__hostTarget ? el.__hostTarget : el.parent;
--
-- if (eventPacket.cancelBubble) {
-- break;
-- }
++ }
++ }
++ _updateAnimationTargets() {
++ for (let i = 0; i < this.animators.length; i++) {
++ const animator = this.animators[i];
++ if (animator.targetName) {
++ animator.changeTarget(this[animator.targetName]);
}
--
-- if (!eventPacket.cancelBubble) {
-- this.trigger(eventName, eventPacket);
--
-- if (this.painter && this.painter.eachOtherLayer) {
-- this.painter.eachOtherLayer(function (layer) {
-- if (typeof layer[eventKey] === 'function') {
-- layer[eventKey].call(layer, eventPacket);
-- }
--
-- if (layer.trigger) {
-- layer.trigger(eventName, eventPacket);
-- }
-- });
-- }
++ }
++ }
++ removeState(state) {
++ const idx = indexOf(this.currentStates, state);
++ if (idx >= 0) {
++ const currentStates = this.currentStates.slice();
++ currentStates.splice(idx, 1);
++ this.useStates(currentStates);
++ }
++ }
++ replaceState(oldState, newState, forceAdd) {
++ const currentStates = this.currentStates.slice();
++ const idx = indexOf(currentStates, oldState);
++ const newStateExists = indexOf(currentStates, newState) >= 0;
++ if (idx >= 0) {
++ if (!newStateExists) {
++ currentStates[idx] = newState;
++ } else {
++ currentStates.splice(idx, 1);
}
-- };
--
-- Handler.prototype.findHover = function (x, y, exclude) {
-- var list = this.storage.getDisplayList();
-- var out = new HoveredResult(x, y);
--
-- for (var i = list.length - 1; i >= 0; i--) {
-- var hoverCheckResult = void 0;
--
-- if (list[i] !== exclude && !list[i].ignore && (hoverCheckResult = isHover(list[i], x, y))) {
-- !out.topTarget && (out.topTarget = list[i]);
--
-- if (hoverCheckResult !== SILENT) {
-- out.target = list[i];
-- break;
++ } else if (forceAdd && !newStateExists) {
++ currentStates.push(newState);
++ }
++ this.useStates(currentStates);
++ }
++ toggleState(state, enable) {
++ if (enable) {
++ this.useState(state, true);
++ } else {
++ this.removeState(state);
++ }
++ }
++ _mergeStates(states36) {
++ const mergedState = {};
++ let mergedTextConfig;
++ for (let i = 0; i < states36.length; i++) {
++ const state = states36[i];
++ extend(mergedState, state);
++ if (state.textConfig) {
++ mergedTextConfig = mergedTextConfig || {};
++ extend(mergedTextConfig, state.textConfig);
++ }
++ }
++ if (mergedTextConfig) {
++ mergedState.textConfig = mergedTextConfig;
++ }
++ return mergedState;
++ }
++ _applyStateObj(stateName, state, normalState, keepCurrentStates, transition, animationCfg) {
++ const needsRestoreToNormal = !(state && keepCurrentStates);
++ if (state && state.textConfig) {
++ this.textConfig = extend({}, keepCurrentStates ? this.textConfig : normalState.textConfig);
++ extend(this.textConfig, state.textConfig);
++ } else if (needsRestoreToNormal) {
++ if (normalState.textConfig) {
++ this.textConfig = normalState.textConfig;
++ }
++ }
++ const transitionTarget = {};
++ let hasTransition = false;
++ for (let i = 0; i < PRIMARY_STATES_KEYS.length; i++) {
++ const key = PRIMARY_STATES_KEYS[i];
++ const propNeedsTransition = transition && DEFAULT_ANIMATABLE_MAP[key];
++ if (state && state[key] != null) {
++ if (propNeedsTransition) {
++ hasTransition = true;
++ transitionTarget[key] = state[key];
++ } else {
++ this[key] = state[key];
++ }
++ } else if (needsRestoreToNormal) {
++ if (normalState[key] != null) {
++ if (propNeedsTransition) {
++ hasTransition = true;
++ transitionTarget[key] = normalState[key];
++ } else {
++ this[key] = normalState[key];
}
}
}
--
-- return out;
-- };
--
-- Handler.prototype.processGesture = function (event, stage) {
-- if (!this._gestureMgr) {
-- this._gestureMgr = new GestureMgr();
- }
-
- var gestureMgr = this._gestureMgr;
- stage === 'start' && gestureMgr.clear();
- var gestureInfo = gestureMgr.recognize(event, this.findHover(event.zrX, event.zrY, null).target, this.proxy.dom);
- stage === 'end' && gestureMgr.clear();
-
- if (gestureInfo) {
- var type = gestureInfo.type;
- event.gestureEvent = type;
- var res = new HoveredResult();
- res.target = gestureInfo.target;
- this.dispatchToElement(res, type, gestureInfo.event);
- }
- };
-
- return Handler;
- }(Eventful);
-
- each(['click', 'mousedown', 'mouseup', 'mousewheel', 'dblclick', 'contextmenu'], function (name) {
- Handler.prototype[name] = function (event) {
- var x = event.zrX;
- var y = event.zrY;
- var isOutside = isOutsideBoundary(this, x, y);
- var hovered;
- var hoveredTarget;
-
- if (name !== 'mouseup' || !isOutside) {
- hovered = this.findHover(x, y);
- hoveredTarget = hovered.target;
- }
-
- if (name === 'mousedown') {
- this._downEl = hoveredTarget;
- this._downPoint = [event.zrX, event.zrY];
- this._upEl = hoveredTarget;
- } else if (name === 'mouseup') {
- this._upEl = hoveredTarget;
- } else if (name === 'click') {
- if (this._downEl !== this._upEl || !this._downPoint || dist(this._downPoint, [event.zrX, event.zrY]) > 4) {
- return;
- }
-
- this._downPoint = null;
- }
-
- this.dispatchToElement(hovered, name, event);
- };
- });
-
- function isHover(displayable, x, y) {
- if (displayable[displayable.rectHover ? 'rectContain' : 'contain'](x, y)) {
- var el = displayable;
- var isSilent = void 0;
- var ignoreClip = false;
-
- while (el) {
- if (el.ignoreClip) {
- ignoreClip = true;
- }
-
- if (!ignoreClip) {
- var clipPath = el.getClipPath();
-
- if (clipPath && !clipPath.contain(x, y)) {
- return false;
- }
-
- if (el.silent) {
- isSilent = true;
- }
- }
-
- var hostEl = el.__hostTarget;
- el = hostEl ? hostEl : el.parent;
++ }
++ if (!transition) {
++ for (let i = 0; i < this.animators.length; i++) {
++ const animator = this.animators[i];
++ const targetName = animator.targetName;
++ animator.__changeFinalValue(targetName ? (state || normalState)[targetName] : state || normalState);
}
--
- return isSilent ? SILENT : true;
- var gestureMgr = this._gestureMgr;
- stage === 'start' && gestureMgr.clear();
- var gestureInfo = gestureMgr.recognize(event, this.findHover(event.zrX, event.zrY, null).target, this.proxy.dom);
- stage === 'end' && gestureMgr.clear();
-
- if (gestureInfo) {
- var type = gestureInfo.type;
- event.gestureEvent = type;
- var res = new HoveredResult();
- res.target = gestureInfo.target;
- this.dispatchToElement(res, type, gestureInfo.event);
+ }
-
- return false;
++ if (hasTransition) {
++ this._transitionState(stateName, transitionTarget, animationCfg);
++ }
+ }
-
- function isOutsideBoundary(handlerInstance, x, y) {
- var painter = handlerInstance.painter;
- return x < 0 || x > painter.getWidth() || y < 0 || y > painter.getHeight();
++ _attachComponent(componentEl) {
++ if (componentEl.__zr && !componentEl.__hostTarget) {
++ throw new Error("Text element has been added to zrender.");
++ }
++ if (componentEl === this) {
++ throw new Error("Recursive component attachment.");
++ }
++ const zr = this.__zr;
++ if (zr) {
++ componentEl.addSelfToZr(zr);
++ }
++ componentEl.__zr = zr;
++ componentEl.__hostTarget = this;
+ }
-
- var DEFAULT_MIN_MERGE = 32;
- var DEFAULT_MIN_GALLOPING = 7;
-
- function minRunLength(n) {
- var r = 0;
-
- while (n >= DEFAULT_MIN_MERGE) {
- r |= n & 1;
- n >>= 1;
++ _detachComponent(componentEl) {
++ if (componentEl.__zr) {
++ componentEl.removeSelfFromZr(componentEl.__zr);
+ }
-
- return n + r;
++ componentEl.__zr = null;
++ componentEl.__hostTarget = null;
+ }
-
- function makeAscendingRun(array, lo, hi, compare) {
- var runHi = lo + 1;
-
- if (runHi === hi) {
- return 1;
++ getClipPath() {
++ return this._clipPath;
++ }
++ setClipPath(clipPath) {
++ if (this._clipPath && this._clipPath !== clipPath) {
++ this.removeClipPath();
+ }
-
- if (compare(array[runHi++], array[lo]) < 0) {
- while (runHi < hi && compare(array[runHi], array[runHi - 1]) < 0) {
- runHi++;
++ this._attachComponent(clipPath);
++ this._clipPath = clipPath;
++ this.markRedraw();
++ }
++ removeClipPath() {
++ const clipPath = this._clipPath;
++ if (clipPath) {
++ this._detachComponent(clipPath);
++ this._clipPath = null;
++ this.markRedraw();
++ }
++ }
++ getTextContent() {
++ return this._textContent;
++ }
++ setTextContent(textEl) {
++ const previousTextContent = this._textContent;
++ if (previousTextContent === textEl) {
++ return;
++ }
++ if (previousTextContent && previousTextContent !== textEl) {
++ this.removeTextContent();
++ }
++ if (textEl.__zr && !textEl.__hostTarget) {
++ throw new Error("Text element has been added to zrender.");
++ }
++ textEl.attachedTransform = new Transformable_default();
++ this._attachComponent(textEl);
++ this._textContent = textEl;
++ this.markRedraw();
++ }
++ setTextConfig(cfg) {
++ if (!this.textConfig) {
++ this.textConfig = {};
++ }
++ extend(this.textConfig, cfg);
++ this.markRedraw();
++ }
++ removeTextContent() {
++ const textEl = this._textContent;
++ if (textEl) {
++ textEl.attachedTransform = null;
++ this._detachComponent(textEl);
++ this._textContent = null;
++ this._innerTextDefaultStyle = null;
++ this.markRedraw();
++ }
++ }
++ getTextGuideLine() {
++ return this._textGuide;
++ }
++ setTextGuideLine(guideLine) {
++ if (this._textGuide && this._textGuide !== guideLine) {
++ this.removeTextGuideLine();
++ }
++ this._attachComponent(guideLine);
++ this._textGuide = guideLine;
++ this.markRedraw();
++ }
++ removeTextGuideLine() {
++ const textGuide = this._textGuide;
++ if (textGuide) {
++ this._detachComponent(textGuide);
++ this._textGuide = null;
++ this.markRedraw();
++ }
++ }
++ markRedraw() {
++ this.__dirty |= Element.REDARAW_BIT;
++ const zr = this.__zr;
++ if (zr) {
++ if (this.__inHover) {
++ zr.refreshHover();
++ } else {
++ zr.refresh();
}
- };
--
- reverseRun(array, lo, runHi);
- } else {
- while (runHi < hi && compare(array[runHi], array[runHi - 1]) >= 0) {
- runHi++;
- return Handler;
- }(Eventful);
-
- each(['click', 'mousedown', 'mouseup', 'mousewheel', 'dblclick', 'contextmenu'], function (name) {
- Handler.prototype[name] = function (event) {
- var x = event.zrX;
- var y = event.zrY;
- var isOutside = isOutsideBoundary(this, x, y);
- var hovered;
- var hoveredTarget;
-
- if (name !== 'mouseup' || !isOutside) {
- hovered = this.findHover(x, y);
- hoveredTarget = hovered.target;
- }
-
- if (name === 'mousedown') {
- this._downEl = hoveredTarget;
- this._downPoint = [event.zrX, event.zrY];
- this._upEl = hoveredTarget;
- } else if (name === 'mouseup') {
- this._upEl = hoveredTarget;
- } else if (name === 'click') {
- if (this._downEl !== this._upEl || !this._downPoint || dist(this._downPoint, [event.zrX, event.zrY]) > 4) {
- return;
- }
-
- this._downPoint = null;
++ }
++ if (this.__hostTarget) {
++ this.__hostTarget.markRedraw();
++ }
++ }
++ dirty() {
++ this.markRedraw();
++ }
++ _toggleHoverLayerFlag(inHover) {
++ this.__inHover = inHover;
++ const textContent = this._textContent;
++ const textGuide = this._textGuide;
++ if (textContent) {
++ textContent.__inHover = inHover;
++ }
++ if (textGuide) {
++ textGuide.__inHover = inHover;
++ }
++ }
++ addSelfToZr(zr) {
++ this.__zr = zr;
++ const animators = this.animators;
++ if (animators) {
++ for (let i = 0; i < animators.length; i++) {
++ zr.animation.addAnimator(animators[i]);
}
-
- this.dispatchToElement(hovered, name, event);
- };
- });
-
- function isHover(displayable, x, y) {
- if (displayable[displayable.rectHover ? 'rectContain' : 'contain'](x, y)) {
- var el = displayable;
- var isSilent = void 0;
- var ignoreClip = false;
-
- while (el) {
- if (el.ignoreClip) {
- ignoreClip = true;
- }
-
- if (!ignoreClip) {
- var clipPath = el.getClipPath();
-
- if (clipPath && !clipPath.contain(x, y)) {
- return false;
- }
-
- if (el.silent) {
- isSilent = true;
- }
- }
-
- var hostEl = el.__hostTarget;
- el = hostEl ? hostEl : el.parent;
+ }
-
- return runHi - lo;
++ if (this._clipPath) {
++ this._clipPath.addSelfToZr(zr);
++ }
++ if (this._textContent) {
++ this._textContent.addSelfToZr(zr);
++ }
++ if (this._textGuide) {
++ this._textGuide.addSelfToZr(zr);
++ }
+ }
-
- function reverseRun(array, lo, hi) {
- hi--;
-
- while (lo < hi) {
- var t = array[lo];
- array[lo++] = array[hi];
- array[hi--] = t;
++ removeSelfFromZr(zr) {
++ this.__zr = null;
++ const animators = this.animators;
++ if (animators) {
++ for (let i = 0; i < animators.length; i++) {
++ zr.animation.removeAnimator(animators[i]);
+ }
-
- return isSilent ? SILENT : true;
+ }
-
- return false;
++ if (this._clipPath) {
++ this._clipPath.removeSelfFromZr(zr);
++ }
++ if (this._textContent) {
++ this._textContent.removeSelfFromZr(zr);
++ }
++ if (this._textGuide) {
++ this._textGuide.removeSelfFromZr(zr);
+ }
}
--
- function binaryInsertionSort(array, lo, hi, start, compare) {
- if (start === lo) {
- start++;
- function isOutsideBoundary(handlerInstance, x, y) {
- var painter = handlerInstance.painter;
- return x < 0 || x > painter.getWidth() || y < 0 || y > painter.getHeight();
- }
-
- function create$1() {
- return [1, 0, 0, 1, 0, 0];
- }
-
- function identity(out) {
- out[0] = 1;
- out[1] = 0;
- out[2] = 0;
- out[3] = 1;
- out[4] = 0;
- out[5] = 0;
- return out;
- }
-
- function copy$1(out, m) {
- out[0] = m[0];
- out[1] = m[1];
- out[2] = m[2];
- out[3] = m[3];
- out[4] = m[4];
- out[5] = m[5];
- return out;
- }
-
- function mul$1(out, m1, m2) {
- var out0 = m1[0] * m2[0] + m1[2] * m2[1];
- var out1 = m1[1] * m2[0] + m1[3] * m2[1];
- var out2 = m1[0] * m2[2] + m1[2] * m2[3];
- var out3 = m1[1] * m2[2] + m1[3] * m2[3];
- var out4 = m1[0] * m2[4] + m1[2] * m2[5] + m1[4];
- var out5 = m1[1] * m2[4] + m1[3] * m2[5] + m1[5];
- out[0] = out0;
- out[1] = out1;
- out[2] = out2;
- out[3] = out3;
- out[4] = out4;
- out[5] = out5;
- return out;
- }
-
- function translate(out, a, v) {
- out[0] = a[0];
- out[1] = a[1];
- out[2] = a[2];
- out[3] = a[3];
- out[4] = a[4] + v[0];
- out[5] = a[5] + v[1];
- return out;
- }
-
- function rotate(out, a, rad) {
- var aa = a[0];
- var ac = a[2];
- var atx = a[4];
- var ab = a[1];
- var ad = a[3];
- var aty = a[5];
- var st = Math.sin(rad);
- var ct = Math.cos(rad);
- out[0] = aa * ct + ab * st;
- out[1] = -aa * st + ab * ct;
- out[2] = ac * ct + ad * st;
- out[3] = -ac * st + ct * ad;
- out[4] = ct * atx + st * aty;
- out[5] = ct * aty - st * atx;
- return out;
- }
-
- function scale$1(out, a, v) {
- var vx = v[0];
- var vy = v[1];
- out[0] = a[0] * vx;
- out[1] = a[1] * vy;
- out[2] = a[2] * vx;
- out[3] = a[3] * vy;
- out[4] = a[4] * vx;
- out[5] = a[5] * vy;
- return out;
- }
-
- function invert(out, a) {
- var aa = a[0];
- var ac = a[2];
- var atx = a[4];
- var ab = a[1];
- var ad = a[3];
- var aty = a[5];
- var det = aa * ad - ab * ac;
-
- if (!det) {
- return null;
++ animate(key, loop) {
++ let target = key ? this[key] : this;
++ if (!target) {
++ logError('Property "' + key + '" is not existed in element ' + this.id);
++ return;
}
-
- for (; start < hi; start++) {
- var pivot = array[start];
- var left = lo;
- var right = start;
- var mid;
-
- while (left < right) {
- mid = left + right >>> 1;
--
- if (compare(pivot, array[mid]) < 0) {
- right = mid;
- } else {
- left = mid + 1;
- }
- det = 1.0 / det;
- out[0] = ad * det;
- out[1] = -ab * det;
- out[2] = -ac * det;
- out[3] = aa * det;
- out[4] = (ac * aty - ad * atx) * det;
- out[5] = (ab * atx - aa * aty) * det;
- return out;
++ const animator = new Animator2(target, loop);
++ this.addAnimator(animator, key);
++ return animator;
++ }
++ addAnimator(animator, key) {
++ const zr = this.__zr;
++ const el = this;
++ animator.during(function() {
++ el.updateDuringAnimation(key);
++ }).done(function() {
++ const animators = el.animators;
++ const idx = indexOf(animators, animator);
++ if (idx >= 0) {
++ animators.splice(idx, 1);
+ }
-
- var n = start - left;
-
- switch (n) {
- case 3:
- array[left + 3] = array[left + 2];
-
- case 2:
- array[left + 2] = array[left + 1];
-
- case 1:
- array[left + 1] = array[left];
- break;
-
- default:
- while (n > 0) {
- array[left + n] = array[left + n - 1];
- n--;
- }
-
++ });
++ this.animators.push(animator);
++ if (zr) {
++ zr.animation.addAnimator(animator);
++ }
++ zr && zr.wakeUp();
++ }
++ updateDuringAnimation(key) {
++ this.markRedraw();
++ }
++ stopAnimation(scope, forwardToLast) {
++ const animators = this.animators;
++ const len2 = animators.length;
++ const leftAnimators = [];
++ for (let i = 0; i < len2; i++) {
++ const animator = animators[i];
++ if (!scope || scope === animator.scope) {
++ animator.stop(forwardToLast);
++ } else {
++ leftAnimators.push(animator);
+ }
-
- array[left] = pivot;
+ }
++ this.animators = leftAnimators;
++ return this;
}
-
- function gallopLeft(value, array, start, length, hint, compare) {
- var lastOffset = 0;
- var maxOffset = 0;
- var offset = 1;
-
- if (compare(value, array[start + hint]) > 0) {
- maxOffset = length - hint;
-
- while (offset < maxOffset && compare(value, array[start + hint + offset]) > 0) {
- lastOffset = offset;
- offset = (offset << 1) + 1;
--
- if (offset <= 0) {
- offset = maxOffset;
- }
- function clone$2(a) {
- var b = create$1();
- copy$1(b, a);
- return b;
++ animateTo(target, cfg, animationProps) {
++ animateTo(this, target, cfg, animationProps);
+ }
-
- var matrix = /*#__PURE__*/Object.freeze({
- __proto__: null,
- create: create$1,
- identity: identity,
- copy: copy$1,
- mul: mul$1,
- translate: translate,
- rotate: rotate,
- scale: scale$1,
- invert: invert,
- clone: clone$2
- });
- var mIdentity = identity;
- var EPSILON = 5e-5;
-
- function isNotAroundZero(val) {
- return val > EPSILON || val < -EPSILON;
++ animateFrom(target, cfg, animationProps) {
++ animateTo(this, target, cfg, animationProps, true);
+ }
-
- var scaleTmp = [];
- var tmpTransform = [];
- var originTransform = create$1();
- var abs = Math.abs;
-
- var Transformable = function () {
- function Transformable() {}
-
- Transformable.prototype.setPosition = function (arr) {
- this.x = arr[0];
- this.y = arr[1];
- };
-
- Transformable.prototype.setScale = function (arr) {
- this.scaleX = arr[0];
- this.scaleY = arr[1];
- };
-
- Transformable.prototype.setOrigin = function (arr) {
- this.originX = arr[0];
- this.originY = arr[1];
- };
-
- Transformable.prototype.needLocalTransform = function () {
- return isNotAroundZero(this.rotation) || isNotAroundZero(this.x) || isNotAroundZero(this.y) || isNotAroundZero(this.scaleX - 1) || isNotAroundZero(this.scaleY - 1);
- };
-
- Transformable.prototype.updateTransform = function () {
- var parent = this.parent;
- var parentHasTransform = parent && parent.transform;
- var needLocalTransform = this.needLocalTransform();
- var m = this.transform;
-
- if (!(needLocalTransform || parentHasTransform)) {
- m && mIdentity(m);
- return;
++ _transitionState(stateName, target, cfg, animationProps) {
++ const animators = animateTo(this, target, cfg, animationProps);
++ for (let i = 0; i < animators.length; i++) {
++ animators[i].__fromStateTransition = stateName;
++ }
++ }
++ getBoundingRect() {
++ return null;
++ }
++ getPaintRect() {
++ return null;
++ }
++}
++Element.REDARAW_BIT = 1;
++Element.initDefaultProps = function() {
++ const elProto = Element.prototype;
++ elProto.type = "element";
++ elProto.name = "";
++ elProto.ignore = false;
++ elProto.silent = false;
++ elProto.isGroup = false;
++ elProto.draggable = false;
++ elProto.dragging = false;
++ elProto.ignoreClip = false;
++ elProto.__inHover = false;
++ elProto.__dirty = Element.REDARAW_BIT;
++ const logs = {};
++ function logDeprecatedError(key, xKey, yKey) {
++ if (!logs[key + xKey + yKey]) {
++ console.warn(`DEPRECATED: '${key}' has been deprecated. use '${xKey}', '${yKey}' instead`);
++ logs[key + xKey + yKey] = true;
++ }
++ }
++ function createLegacyProperty(key, privateKey, xKey, yKey) {
++ Object.defineProperty(elProto, key, {
++ get() {
++ logDeprecatedError(key, xKey, yKey);
++ if (!this[privateKey]) {
++ const pos = this[privateKey] = [];
++ enhanceArray(this, pos);
++ }
++ return this[privateKey];
++ },
++ set(pos) {
++ logDeprecatedError(key, xKey, yKey);
++ this[xKey] = pos[0];
++ this[yKey] = pos[1];
++ this[privateKey] = pos;
++ enhanceArray(this, pos);
}
--
- if (offset > maxOffset) {
- offset = maxOffset;
- m = m || create$1();
-
- if (needLocalTransform) {
- this.getLocalTransform(m);
++ });
++ function enhanceArray(self2, pos) {
++ Object.defineProperty(pos, 0, {
++ get() {
++ return self2[xKey];
++ },
++ set(val) {
++ self2[xKey] = val;
++ }
++ });
++ Object.defineProperty(pos, 1, {
++ get() {
++ return self2[yKey];
++ },
++ set(val) {
++ self2[yKey] = val;
++ }
++ });
++ }
++ }
++ if (Object.defineProperty && (!env_default.browser.ie || env_default.browser.version > 8)) {
++ createLegacyProperty("position", "_legacyPos", "x", "y");
++ createLegacyProperty("scale", "_legacyScale", "scaleX", "scaleY");
++ createLegacyProperty("origin", "_legacyOrigin", "originX", "originY");
++ }
++}();
++mixin(Element, Eventful2);
++mixin(Element, Transformable_default);
++function animateTo(animatable, target, cfg, animationProps, reverse2) {
++ cfg = cfg || {};
++ const animators = [];
++ animateToShallow(animatable, "", animatable, target, cfg, animationProps, animators, reverse2);
++ let doneCount = animators.length;
++ let abortedCount = doneCount;
++ const cfgDone = cfg.done;
++ const cfgAborted = cfg.aborted;
++ const doneCb = cfgDone ? () => {
++ doneCount--;
++ if (!doneCount) {
++ cfgDone();
++ }
++ } : null;
++ const abortedCb = cfgAborted ? () => {
++ abortedCount--;
++ if (!abortedCount) {
++ cfgAborted();
++ }
++ } : null;
++ if (!doneCount) {
++ cfgDone && cfgDone();
++ }
++ if (animators.length > 0 && cfg.during) {
++ animators[0].during((target2, percent) => {
++ cfg.during(percent);
++ });
++ }
++ for (let i = 0; i < animators.length; i++) {
++ const animator = animators[i];
++ if (doneCb) {
++ animator.done(doneCb);
++ }
++ if (abortedCb) {
++ animator.aborted(abortedCb);
++ }
++ animator.start(cfg.easing, cfg.force);
++ }
++ return animators;
++}
++function copyArrShallow(source, target, len2) {
++ for (let i = 0; i < len2; i++) {
++ source[i] = target[i];
++ }
++}
++function is2DArray(value) {
++ return isArrayLike(value[0]);
++}
++function copyValue(target, source, key) {
++ if (isArrayLike(source[key])) {
++ if (!isArrayLike(target[key])) {
++ target[key] = [];
++ }
++ if (isTypedArray(source[key])) {
++ const len2 = source[key].length;
++ if (target[key].length !== len2) {
++ target[key] = new source[key].constructor(len2);
++ copyArrShallow(target[key], source[key], len2);
+ }
-
- lastOffset += hint;
- offset += hint;
+ } else {
- maxOffset = hint + 1;
-
- while (offset < maxOffset && compare(value, array[start + hint - offset]) <= 0) {
- lastOffset = offset;
- offset = (offset << 1) + 1;
-
- if (offset <= 0) {
- offset = maxOffset;
++ const sourceArr = source[key];
++ const targetArr = target[key];
++ const len0 = sourceArr.length;
++ if (is2DArray(sourceArr)) {
++ const len1 = sourceArr[0].length;
++ for (let i = 0; i < len0; i++) {
++ if (!targetArr[i]) {
++ targetArr[i] = Array.prototype.slice.call(sourceArr[i]);
++ } else {
++ copyArrShallow(targetArr[i], sourceArr[i], len1);
++ }
+ }
+ } else {
- mIdentity(m);
++ copyArrShallow(targetArr, sourceArr, len0);
}
-
- if (offset > maxOffset) {
- offset = maxOffset;
- }
--
- var tmp = lastOffset;
- lastOffset = hint - offset;
- offset = hint - tmp;
- if (parentHasTransform) {
- if (needLocalTransform) {
- mul$1(m, parent.transform, m);
- } else {
- copy$1(m, parent.transform);
++ targetArr.length = sourceArr.length;
+ }
-
- lastOffset++;
-
- while (lastOffset < offset) {
- var m = lastOffset + (offset - lastOffset >>> 1);
-
- if (compare(value, array[start + m]) > 0) {
- lastOffset = m + 1;
++ } else {
++ target[key] = source[key];
++ }
++}
++function animateToShallow(animatable, topKey, source, target, cfg, animationProps, animators, reverse2) {
++ const animatableKeys = [];
++ const changedKeys = [];
++ const targetKeys = keys(target);
++ const duration = cfg.duration;
++ const delay = cfg.delay;
++ const additive = cfg.additive;
++ const setToFinal = cfg.setToFinal;
++ const animateAll = !isObject(animationProps);
++ for (let k = 0; k < targetKeys.length; k++) {
++ const innerKey = targetKeys[k];
++ if (source[innerKey] != null && target[innerKey] != null && (animateAll || animationProps[innerKey])) {
++ if (isObject(target[innerKey]) && !isArrayLike(target[innerKey])) {
++ if (topKey) {
++ if (!reverse2) {
++ source[innerKey] = target[innerKey];
++ animatable.updateDuringAnimation(topKey);
++ }
++ continue;
+ }
++ animateToShallow(animatable, innerKey, source[innerKey], target[innerKey], cfg, animationProps && animationProps[innerKey], animators, reverse2);
+ } else {
- offset = m;
++ animatableKeys.push(innerKey);
++ changedKeys.push(innerKey);
}
-
- this.transform = m;
-
- this._resolveGlobalScaleRatio(m);
- };
-
- Transformable.prototype._resolveGlobalScaleRatio = function (m) {
- var globalScaleRatio = this.globalScaleRatio;
-
- if (globalScaleRatio != null && globalScaleRatio !== 1) {
- this.getGlobalScale(scaleTmp);
- var relX = scaleTmp[0] < 0 ? -1 : 1;
- var relY = scaleTmp[1] < 0 ? -1 : 1;
- var sx = ((scaleTmp[0] - relX) * globalScaleRatio + relX) / scaleTmp[0] || 0;
- var sy = ((scaleTmp[1] - relY) * globalScaleRatio + relY) / scaleTmp[1] || 0;
- m[0] *= sx;
- m[1] *= sx;
- m[2] *= sy;
- m[3] *= sy;
++ } else if (!reverse2) {
++ source[innerKey] = target[innerKey];
++ animatable.updateDuringAnimation(topKey);
++ changedKeys.push(innerKey);
+ }
-
- return offset;
+ }
-
- function gallopRight(value, array, start, length, hint, compare) {
- var lastOffset = 0;
- var maxOffset = 0;
- var offset = 1;
-
- if (compare(value, array[start + hint]) < 0) {
- maxOffset = hint + 1;
-
- while (offset < maxOffset && compare(value, array[start + hint - offset]) < 0) {
- lastOffset = offset;
- offset = (offset << 1) + 1;
-
- if (offset <= 0) {
- offset = maxOffset;
++ const keyLen = animatableKeys.length;
++ if (keyLen > 0 || cfg.force) {
++ const existsAnimators = animatable.animators;
++ let existsAnimatorsOnSameTarget = [];
++ for (let i = 0; i < existsAnimators.length; i++) {
++ if (existsAnimators[i].targetName === topKey) {
++ existsAnimatorsOnSameTarget.push(existsAnimators[i]);
+ }
-
- this.invTransform = this.invTransform || create$1();
- invert(this.invTransform, m);
- };
-
- Transformable.prototype.getLocalTransform = function (m) {
- return Transformable.getLocalTransform(this, m);
- };
-
- Transformable.prototype.getComputedTransform = function () {
- var transformNode = this;
- var ancestors = [];
-
- while (transformNode) {
- ancestors.push(transformNode);
- transformNode = transformNode.parent;
++ }
++ if (!additive && existsAnimatorsOnSameTarget.length) {
++ for (let i = 0; i < existsAnimatorsOnSameTarget.length; i++) {
++ const allAborted = existsAnimatorsOnSameTarget[i].stopTracks(changedKeys);
++ if (allAborted) {
++ const idx = indexOf(existsAnimators, existsAnimatorsOnSameTarget[i]);
++ existsAnimators.splice(idx, 1);
+ }
}
--
- if (offset > maxOffset) {
- offset = maxOffset;
- while (transformNode = ancestors.pop()) {
- transformNode.updateTransform();
++ }
++ let revertedSource;
++ let reversedTarget;
++ let sourceClone;
++ if (reverse2) {
++ reversedTarget = {};
++ if (setToFinal) {
++ revertedSource = {};
}
-
- var tmp = lastOffset;
- lastOffset = hint - offset;
- offset = hint - tmp;
- } else {
- maxOffset = length - hint;
--
- while (offset < maxOffset && compare(value, array[start + hint + offset]) >= 0) {
- lastOffset = offset;
- offset = (offset << 1) + 1;
- return this.transform;
- };
--
- if (offset <= 0) {
- offset = maxOffset;
- Transformable.prototype.setLocalTransform = function (m) {
- if (!m) {
- return;
++ for (let i = 0; i < keyLen; i++) {
++ const innerKey = animatableKeys[i];
++ reversedTarget[innerKey] = source[innerKey];
++ if (setToFinal) {
++ revertedSource[innerKey] = target[innerKey];
++ } else {
++ source[innerKey] = target[innerKey];
+ }
}
--
- if (offset > maxOffset) {
- offset = maxOffset;
- var sx = m[0] * m[0] + m[1] * m[1];
- var sy = m[2] * m[2] + m[3] * m[3];
-
- if (isNotAroundZero(sx - 1)) {
- sx = Math.sqrt(sx);
++ } else if (setToFinal) {
++ sourceClone = {};
++ for (let i = 0; i < keyLen; i++) {
++ const innerKey = animatableKeys[i];
++ sourceClone[innerKey] = cloneValue(source[innerKey]);
++ copyValue(source, target, innerKey);
}
-
- lastOffset += hint;
- offset += hint;
+ }
-
- lastOffset++;
-
- while (lastOffset < offset) {
- var m = lastOffset + (offset - lastOffset >>> 1);
-
- if (compare(value, array[start + m]) < 0) {
- offset = m;
- } else {
- lastOffset = m + 1;
- }
++ const animator = new Animator2(source, false, additive ? existsAnimatorsOnSameTarget : null);
++ animator.targetName = topKey;
++ if (cfg.scope) {
++ animator.scope = cfg.scope;
+ }
-
- return offset;
++ if (setToFinal && revertedSource) {
++ animator.whenWithKeys(0, revertedSource, animatableKeys);
++ }
++ if (sourceClone) {
++ animator.whenWithKeys(0, sourceClone, animatableKeys);
++ }
++ animator.whenWithKeys(duration == null ? 500 : duration, reverse2 ? reversedTarget : target, animatableKeys).delay(delay || 0);
++ animatable.addAnimator(animator, topKey);
++ animators.push(animator);
+ }
++}
++const Element_default = Element;
- function TimSort(array, compare) {
- var minGallop = DEFAULT_MIN_GALLOPING;
- var length = 0;
- var runStart;
- var runLength;
- var stackSize = 0;
- length = array.length;
- var tmp = [];
- runStart = [];
- runLength = [];
-
- function pushRun(_runStart, _runLength) {
- runStart[stackSize] = _runStart;
- runLength[stackSize] = _runLength;
- stackSize += 1;
- if (isNotAroundZero(sy - 1)) {
- sy = Math.sqrt(sy);
++// node_modules/zrender/src/core/timsort.ts
++const DEFAULT_MIN_MERGE = 32;
++const DEFAULT_MIN_GALLOPING = 7;
++const DEFAULT_TMP_STORAGE_LENGTH = 256;
++function minRunLength(n) {
++ var r = 0;
++ while (n >= DEFAULT_MIN_MERGE) {
++ r |= n & 1;
++ n >>= 1;
++ }
++ return n + r;
++}
++function makeAscendingRun(array, lo, hi, compare2) {
++ var runHi = lo + 1;
++ if (runHi === hi) {
++ return 1;
++ }
++ if (compare2(array[runHi++], array[lo]) < 0) {
++ while (runHi < hi && compare2(array[runHi], array[runHi - 1]) < 0) {
++ runHi++;
+ }
-
- function mergeRuns() {
- while (stackSize > 1) {
- var n = stackSize - 2;
-
- if (n >= 1 && runLength[n - 1] <= runLength[n] + runLength[n + 1] || n >= 2 && runLength[n - 2] <= runLength[n] + runLength[n - 1]) {
- if (runLength[n - 1] < runLength[n + 1]) {
- n--;
- }
- } else if (runLength[n] > runLength[n + 1]) {
- break;
- }
-
- mergeAt(n);
++ reverseRun(array, lo, runHi);
++ } else {
++ while (runHi < hi && compare2(array[runHi], array[runHi - 1]) >= 0) {
++ runHi++;
++ }
++ }
++ return runHi - lo;
++}
++function reverseRun(array, lo, hi) {
++ hi--;
++ while (lo < hi) {
++ var t = array[lo];
++ array[lo++] = array[hi];
++ array[hi--] = t;
++ }
++}
++function binaryInsertionSort(array, lo, hi, start2, compare2) {
++ if (start2 === lo) {
++ start2++;
++ }
++ for (; start2 < hi; start2++) {
++ var pivot = array[start2];
++ var left = lo;
++ var right = start2;
++ var mid;
++ while (left < right) {
++ mid = left + right >>> 1;
++ if (compare2(pivot, array[mid]) < 0) {
++ right = mid;
++ } else {
++ left = mid + 1;
}
-
- this.rotation = Math.atan2(-m[1] / sy, m[0] / sx);
-
- if (m[0] < 0) {
- sx = -sx;
+ }
-
- function forceMergeRuns() {
- while (stackSize > 1) {
- var n = stackSize - 2;
-
- if (n > 0 && runLength[n - 1] < runLength[n + 1]) {
++ var n = start2 - left;
++ switch (n) {
++ case 3:
++ array[left + 3] = array[left + 2];
++ case 2:
++ array[left + 2] = array[left + 1];
++ case 1:
++ array[left + 1] = array[left];
++ break;
++ default:
++ while (n > 0) {
++ array[left + n] = array[left + n - 1];
+ n--;
+ }
-
- mergeAt(n);
- }
+ }
-
- function mergeAt(i) {
- var start1 = runStart[i];
- var length1 = runLength[i];
- var start2 = runStart[i + 1];
- var length2 = runLength[i + 1];
- runLength[i] = length1 + length2;
-
- if (i === stackSize - 3) {
- runStart[i + 1] = runStart[i + 2];
- runLength[i + 1] = runLength[i + 2];
- }
-
- stackSize--;
- var k = gallopRight(array[start2], array, start1, length1, 0, compare);
- start1 += k;
- length1 -= k;
-
- if (length1 === 0) {
- return;
++ array[left] = pivot;
++ }
++}
++function gallopLeft(value, array, start2, length2, hint, compare2) {
++ var lastOffset = 0;
++ var maxOffset = 0;
++ var offset = 1;
++ if (compare2(value, array[start2 + hint]) > 0) {
++ maxOffset = length2 - hint;
++ while (offset < maxOffset && compare2(value, array[start2 + hint + offset]) > 0) {
++ lastOffset = offset;
++ offset = (offset << 1) + 1;
++ if (offset <= 0) {
++ offset = maxOffset;
}
-
- length2 = gallopLeft(array[start1 + length1 - 1], array, start2, length2, length2 - 1, compare);
--
- if (length2 === 0) {
- return;
- if (m[3] < 0) {
- sy = -sy;
++ }
++ if (offset > maxOffset) {
++ offset = maxOffset;
++ }
++ lastOffset += hint;
++ offset += hint;
++ } else {
++ maxOffset = hint + 1;
++ while (offset < maxOffset && compare2(value, array[start2 + hint - offset]) <= 0) {
++ lastOffset = offset;
++ offset = (offset << 1) + 1;
++ if (offset <= 0) {
++ offset = maxOffset;
}
--
- if (length1 <= length2) {
- mergeLow(start1, length1, start2, length2);
- } else {
- mergeHigh(start1, length1, start2, length2);
- if (sx < 0 && sy < 0) {
- this.rotation += Math.PI;
- sx = -sx;
- sy = -sy;
++ }
++ if (offset > maxOffset) {
++ offset = maxOffset;
++ }
++ var tmp = lastOffset;
++ lastOffset = hint - offset;
++ offset = hint - tmp;
++ }
++ lastOffset++;
++ while (lastOffset < offset) {
++ var m2 = lastOffset + (offset - lastOffset >>> 1);
++ if (compare2(value, array[start2 + m2]) > 0) {
++ lastOffset = m2 + 1;
++ } else {
++ offset = m2;
++ }
++ }
++ return offset;
++}
++function gallopRight(value, array, start2, length2, hint, compare2) {
++ var lastOffset = 0;
++ var maxOffset = 0;
++ var offset = 1;
++ if (compare2(value, array[start2 + hint]) < 0) {
++ maxOffset = hint + 1;
++ while (offset < maxOffset && compare2(value, array[start2 + hint - offset]) < 0) {
++ lastOffset = offset;
++ offset = (offset << 1) + 1;
++ if (offset <= 0) {
++ offset = maxOffset;
}
-
- this.x = m[4];
- this.y = m[5];
- this.scaleX = sx;
- this.scaleY = sy;
- };
-
- Transformable.prototype.decomposeTransform = function () {
- if (!this.transform) {
- return;
+ }
-
- function mergeLow(start1, length1, start2, length2) {
- var i = 0;
-
- for (i = 0; i < length1; i++) {
- tmp[i] = array[start1 + i];
++ if (offset > maxOffset) {
++ offset = maxOffset;
++ }
++ var tmp = lastOffset;
++ lastOffset = hint - offset;
++ offset = hint - tmp;
++ } else {
++ maxOffset = length2 - hint;
++ while (offset < maxOffset && compare2(value, array[start2 + hint + offset]) >= 0) {
++ lastOffset = offset;
++ offset = (offset << 1) + 1;
++ if (offset <= 0) {
++ offset = maxOffset;
}
--
- var cursor1 = 0;
- var cursor2 = start2;
- var dest = start1;
- array[dest++] = array[cursor2++];
- var parent = this.parent;
- var m = this.transform;
--
- if (--length2 === 0) {
- for (i = 0; i < length1; i++) {
- array[dest + i] = tmp[cursor1 + i];
- if (parent && parent.transform) {
- mul$1(tmpTransform, parent.invTransform, m);
- m = tmpTransform;
++ }
++ if (offset > maxOffset) {
++ offset = maxOffset;
++ }
++ lastOffset += hint;
++ offset += hint;
++ }
++ lastOffset++;
++ while (lastOffset < offset) {
++ var m2 = lastOffset + (offset - lastOffset >>> 1);
++ if (compare2(value, array[start2 + m2]) < 0) {
++ offset = m2;
++ } else {
++ lastOffset = m2 + 1;
++ }
++ }
++ return offset;
++}
++function TimSort(array, compare2) {
++ let minGallop = DEFAULT_MIN_GALLOPING;
++ let length2 = 0;
++ let tmpStorageLength = DEFAULT_TMP_STORAGE_LENGTH;
++ let stackLength = 0;
++ let runStart;
++ let runLength;
++ let stackSize = 0;
++ length2 = array.length;
++ if (length2 < 2 * DEFAULT_TMP_STORAGE_LENGTH) {
++ tmpStorageLength = length2 >>> 1;
++ }
++ var tmp = [];
++ stackLength = length2 < 120 ? 5 : length2 < 1542 ? 10 : length2 < 119151 ? 19 : 40;
++ runStart = [];
++ runLength = [];
++ function pushRun(_runStart, _runLength) {
++ runStart[stackSize] = _runStart;
++ runLength[stackSize] = _runLength;
++ stackSize += 1;
++ }
++ function mergeRuns() {
++ while (stackSize > 1) {
++ var n = stackSize - 2;
++ if (n >= 1 && runLength[n - 1] <= runLength[n] + runLength[n + 1] || n >= 2 && runLength[n - 2] <= runLength[n] + runLength[n - 1]) {
++ if (runLength[n - 1] < runLength[n + 1]) {
++ n--;
+ }
-
- return;
++ } else if (runLength[n] > runLength[n + 1]) {
++ break;
}
--
- if (length1 === 1) {
- for (i = 0; i < length2; i++) {
- array[dest + i] = array[cursor2 + i];
- }
- var ox = this.originX;
- var oy = this.originY;
--
- array[dest + length2] = tmp[cursor1];
- return;
- if (ox || oy) {
- originTransform[4] = ox;
- originTransform[5] = oy;
- mul$1(tmpTransform, m, originTransform);
- tmpTransform[4] -= ox;
- tmpTransform[5] -= oy;
- m = tmpTransform;
++ mergeAt(n);
++ }
++ }
++ function forceMergeRuns() {
++ while (stackSize > 1) {
++ var n = stackSize - 2;
++ if (n > 0 && runLength[n - 1] < runLength[n + 1]) {
++ n--;
}
-
- var _minGallop = minGallop;
- var count1;
- var count2;
- var exit;
-
- while (1) {
- count1 = 0;
- count2 = 0;
- exit = false;
-
- do {
- if (compare(array[cursor2], tmp[cursor1]) < 0) {
- array[dest++] = array[cursor2++];
- count2++;
- count1 = 0;
-
- if (--length2 === 0) {
- exit = true;
- break;
- }
- } else {
- array[dest++] = tmp[cursor1++];
- count1++;
- count2 = 0;
-
- if (--length1 === 1) {
- exit = true;
- break;
- }
- }
- } while ((count1 | count2) < _minGallop);
-
- if (exit) {
- break;
- }
-
- do {
- count1 = gallopRight(array[cursor2], tmp, cursor1, length1, 0, compare);
-
- if (count1 !== 0) {
- for (i = 0; i < count1; i++) {
- array[dest + i] = tmp[cursor1 + i];
- }
--
- dest += count1;
- cursor1 += count1;
- length1 -= count1;
- this.setLocalTransform(m);
- };
--
- if (length1 <= 1) {
- exit = true;
- break;
- }
- }
- Transformable.prototype.getGlobalScale = function (out) {
- var m = this.transform;
- out = out || [];
--
- if (!m) {
- out[0] = 1;
- out[1] = 1;
- return out;
++ mergeAt(n);
++ }
++ }
++ function mergeAt(i) {
++ var start1 = runStart[i];
++ var length1 = runLength[i];
++ var start2 = runStart[i + 1];
++ var length22 = runLength[i + 1];
++ runLength[i] = length1 + length22;
++ if (i === stackSize - 3) {
++ runStart[i + 1] = runStart[i + 2];
++ runLength[i + 1] = runLength[i + 2];
++ }
++ stackSize--;
++ var k = gallopRight(array[start2], array, start1, length1, 0, compare2);
++ start1 += k;
++ length1 -= k;
++ if (length1 === 0) {
++ return;
++ }
++ length22 = gallopLeft(array[start1 + length1 - 1], array, start2, length22, length22 - 1, compare2);
++ if (length22 === 0) {
++ return;
++ }
++ if (length1 <= length22) {
++ mergeLow(start1, length1, start2, length22);
++ } else {
++ mergeHigh(start1, length1, start2, length22);
++ }
++ }
++ function mergeLow(start1, length1, start2, length22) {
++ var i = 0;
++ for (i = 0; i < length1; i++) {
++ tmp[i] = array[start1 + i];
++ }
++ var cursor1 = 0;
++ var cursor2 = start2;
++ var dest = start1;
++ array[dest++] = array[cursor2++];
++ if (--length22 === 0) {
++ for (i = 0; i < length1; i++) {
++ array[dest + i] = tmp[cursor1 + i];
+ }
-
- out[0] = Math.sqrt(m[0] * m[0] + m[1] * m[1]);
- out[1] = Math.sqrt(m[2] * m[2] + m[3] * m[3]);
-
- if (m[0] < 0) {
- out[0] = -out[0];
++ return;
++ }
++ if (length1 === 1) {
++ for (i = 0; i < length22; i++) {
++ array[dest + i] = array[cursor2 + i];
+ }
-
- if (m[3] < 0) {
- out[1] = -out[1];
++ array[dest + length22] = tmp[cursor1];
++ return;
++ }
++ var _minGallop = minGallop;
++ var count1;
++ var count2;
++ var exit;
++ while (1) {
++ count1 = 0;
++ count2 = 0;
++ exit = false;
++ do {
++ if (compare2(array[cursor2], tmp[cursor1]) < 0) {
+ array[dest++] = array[cursor2++];
-
- if (--length2 === 0) {
++ count2++;
++ count1 = 0;
++ if (--length22 === 0) {
+ exit = true;
+ break;
+ }
-
- count2 = gallopLeft(tmp[cursor1], array, cursor2, length2, 0, compare);
-
- if (count2 !== 0) {
- for (i = 0; i < count2; i++) {
- array[dest + i] = array[cursor2 + i];
- }
-
- dest += count2;
- cursor2 += count2;
- length2 -= count2;
-
- if (length2 === 0) {
- exit = true;
- break;
- }
- }
-
++ } else {
+ array[dest++] = tmp[cursor1++];
-
++ count1++;
++ count2 = 0;
+ if (--length1 === 1) {
+ exit = true;
+ break;
+ }
-
- _minGallop--;
- } while (count1 >= DEFAULT_MIN_GALLOPING || count2 >= DEFAULT_MIN_GALLOPING);
-
- if (exit) {
- break;
- }
-
- if (_minGallop < 0) {
- _minGallop = 0;
+ }
-
- _minGallop += 2;
++ } while ((count1 | count2) < _minGallop);
++ if (exit) {
++ break;
}
--
- minGallop = _minGallop;
- minGallop < 1 && (minGallop = 1);
- return out;
- };
--
- if (length1 === 1) {
- for (i = 0; i < length2; i++) {
- array[dest + i] = array[cursor2 + i];
- Transformable.prototype.transformCoordToLocal = function (x, y) {
- var v2 = [x, y];
- var invTransform = this.invTransform;
-
- if (invTransform) {
- applyTransform(v2, v2, invTransform);
- }
-
- return v2;
- };
-
- Transformable.prototype.transformCoordToGlobal = function (x, y) {
- var v2 = [x, y];
- var transform = this.transform;
-
- if (transform) {
- applyTransform(v2, v2, transform);
++ do {
++ count1 = gallopRight(array[cursor2], tmp, cursor1, length1, 0, compare2);
++ if (count1 !== 0) {
++ for (i = 0; i < count1; i++) {
++ array[dest + i] = tmp[cursor1 + i];
++ }
++ dest += count1;
++ cursor1 += count1;
++ length1 -= count1;
++ if (length1 <= 1) {
++ exit = true;
++ break;
++ }
+ }
-
- array[dest + length2] = tmp[cursor1];
- } else if (length1 === 0) {
- throw new Error();
- } else {
- for (i = 0; i < length1; i++) {
- array[dest + i] = tmp[cursor1 + i];
++ array[dest++] = array[cursor2++];
++ if (--length22 === 0) {
++ exit = true;
++ break;
++ }
++ count2 = gallopLeft(tmp[cursor1], array, cursor2, length22, 0, compare2);
++ if (count2 !== 0) {
++ for (i = 0; i < count2; i++) {
++ array[dest + i] = array[cursor2 + i];
++ }
++ dest += count2;
++ cursor2 += count2;
++ length22 -= count2;
++ if (length22 === 0) {
++ exit = true;
++ break;
++ }
++ }
++ array[dest++] = tmp[cursor1++];
++ if (--length1 === 1) {
++ exit = true;
++ break;
+ }
++ _minGallop--;
++ } while (count1 >= DEFAULT_MIN_GALLOPING || count2 >= DEFAULT_MIN_GALLOPING);
++ if (exit) {
++ break;
+ }
-
- return v2;
- };
-
- Transformable.prototype.getLineScale = function () {
- var m = this.transform;
- return m && abs(m[0] - 1) > 1e-10 && abs(m[3] - 1) > 1e-10 ? Math.sqrt(abs(m[0] * m[3] - m[2] * m[1])) : 1;
- };
-
- Transformable.getLocalTransform = function (target, m) {
- m = m || [];
- mIdentity(m);
- var ox = target.originX || 0;
- var oy = target.originY || 0;
- var sx = target.scaleX;
- var sy = target.scaleY;
- var rotation = target.rotation || 0;
- var x = target.x;
- var y = target.y;
- m[4] -= ox;
- m[5] -= oy;
- m[0] *= sx;
- m[1] *= sy;
- m[2] *= sx;
- m[3] *= sy;
- m[4] *= sx;
- m[5] *= sy;
-
- if (rotation) {
- rotate(m, m, rotation);
- }
-
- m[4] += ox;
- m[5] += oy;
- m[4] += x;
- m[5] += y;
- return m;
- };
-
- Transformable.initDefaultProps = function () {
- var proto = Transformable.prototype;
- proto.x = 0;
- proto.y = 0;
- proto.scaleX = 1;
- proto.scaleY = 1;
- proto.originX = 0;
- proto.originY = 0;
- proto.rotation = 0;
- proto.globalScaleRatio = 1;
- }();
-
- return Transformable;
- }();
-
- var easing = {
- linear: function (k) {
- return k;
- },
- quadraticIn: function (k) {
- return k * k;
- },
- quadraticOut: function (k) {
- return k * (2 - k);
- },
- quadraticInOut: function (k) {
- if ((k *= 2) < 1) {
- return 0.5 * k * k;
++ if (_minGallop < 0) {
++ _minGallop = 0;
}
-
- return -0.5 * (--k * (k - 2) - 1);
- },
- cubicIn: function (k) {
- return k * k * k;
- },
- cubicOut: function (k) {
- return --k * k * k + 1;
- },
- cubicInOut: function (k) {
- if ((k *= 2) < 1) {
- return 0.5 * k * k * k;
++ _minGallop += 2;
+ }
-
- function mergeHigh(start1, length1, start2, length2) {
- var i = 0;
-
- for (i = 0; i < length2; i++) {
- tmp[i] = array[start2 + i];
++ minGallop = _minGallop;
++ minGallop < 1 && (minGallop = 1);
++ if (length1 === 1) {
++ for (i = 0; i < length22; i++) {
++ array[dest + i] = array[cursor2 + i];
}
-
- var cursor1 = start1 + length1 - 1;
- var cursor2 = length2 - 1;
- var dest = start2 + length2 - 1;
- var customCursor = 0;
- var customDest = 0;
- array[dest--] = array[cursor1--];
-
- if (--length1 === 0) {
- customCursor = dest - (length2 - 1);
-
- for (i = 0; i < length2; i++) {
- array[customCursor + i] = tmp[i];
- }
--
- return;
- return 0.5 * ((k -= 2) * k * k + 2);
- },
- quarticIn: function (k) {
- return k * k * k * k;
- },
- quarticOut: function (k) {
- return 1 - --k * k * k * k;
- },
- quarticInOut: function (k) {
- if ((k *= 2) < 1) {
- return 0.5 * k * k * k * k;
++ array[dest + length22] = tmp[cursor1];
++ } else if (length1 === 0) {
++ throw new Error();
++ } else {
++ for (i = 0; i < length1; i++) {
++ array[dest + i] = tmp[cursor1 + i];
}
-
- if (length2 === 1) {
- dest -= length1;
- cursor1 -= length1;
- customDest = dest + 1;
- customCursor = cursor1 + 1;
-
- for (i = length1 - 1; i >= 0; i--) {
- array[customDest + i] = array[customCursor + i];
- }
--
- array[dest] = tmp[cursor2];
- return;
- return -0.5 * ((k -= 2) * k * k * k - 2);
- },
- quinticIn: function (k) {
- return k * k * k * k * k;
- },
- quinticOut: function (k) {
- return --k * k * k * k * k + 1;
- },
- quinticInOut: function (k) {
- if ((k *= 2) < 1) {
- return 0.5 * k * k * k * k * k;
++ }
++ }
++ function mergeHigh(start1, length1, start2, length22) {
++ var i = 0;
++ for (i = 0; i < length22; i++) {
++ tmp[i] = array[start2 + i];
++ }
++ var cursor1 = start1 + length1 - 1;
++ var cursor2 = length22 - 1;
++ var dest = start2 + length22 - 1;
++ var customCursor = 0;
++ var customDest = 0;
++ array[dest--] = array[cursor1--];
++ if (--length1 === 0) {
++ customCursor = dest - (length22 - 1);
++ for (i = 0; i < length22; i++) {
++ array[customCursor + i] = tmp[i];
}
-
- var _minGallop = minGallop;
-
- while (true) {
- var count1 = 0;
- var count2 = 0;
- var exit = false;
-
- do {
- if (compare(tmp[cursor2], array[cursor1]) < 0) {
- array[dest--] = array[cursor1--];
- count1++;
- count2 = 0;
-
- if (--length1 === 0) {
- exit = true;
- break;
- }
- } else {
- array[dest--] = tmp[cursor2--];
- count2++;
- count1 = 0;
-
- if (--length2 === 1) {
- exit = true;
- break;
- }
- }
- } while ((count1 | count2) < _minGallop);
-
- if (exit) {
- break;
- }
-
- do {
- count1 = length1 - gallopRight(tmp[cursor2], array, start1, length1, length1 - 1, compare);
-
- if (count1 !== 0) {
- dest -= count1;
- cursor1 -= count1;
- length1 -= count1;
- customDest = dest + 1;
- customCursor = cursor1 + 1;
-
- for (i = count1 - 1; i >= 0; i--) {
- array[customDest + i] = array[customCursor + i];
- }
--
- if (length1 === 0) {
- exit = true;
- break;
- }
- return 0.5 * ((k -= 2) * k * k * k * k + 2);
- },
- sinusoidalIn: function (k) {
- return 1 - Math.cos(k * Math.PI / 2);
- },
- sinusoidalOut: function (k) {
- return Math.sin(k * Math.PI / 2);
- },
- sinusoidalInOut: function (k) {
- return 0.5 * (1 - Math.cos(Math.PI * k));
- },
- exponentialIn: function (k) {
- return k === 0 ? 0 : Math.pow(1024, k - 1);
- },
- exponentialOut: function (k) {
- return k === 1 ? 1 : 1 - Math.pow(2, -10 * k);
- },
- exponentialInOut: function (k) {
- if (k === 0) {
- return 0;
++ return;
++ }
++ if (length22 === 1) {
++ dest -= length1;
++ cursor1 -= length1;
++ customDest = dest + 1;
++ customCursor = cursor1 + 1;
++ for (i = length1 - 1; i >= 0; i--) {
++ array[customDest + i] = array[customCursor + i];
+ }
-
- if (k === 1) {
- return 1;
++ array[dest] = tmp[cursor2];
++ return;
++ }
++ var _minGallop = minGallop;
++ while (true) {
++ var count1 = 0;
++ var count2 = 0;
++ var exit = false;
++ do {
++ if (compare2(tmp[cursor2], array[cursor1]) < 0) {
++ array[dest--] = array[cursor1--];
++ count1++;
++ count2 = 0;
++ if (--length1 === 0) {
++ exit = true;
++ break;
+ }
-
++ } else {
+ array[dest--] = tmp[cursor2--];
-
- if (--length2 === 1) {
++ count2++;
++ count1 = 0;
++ if (--length22 === 1) {
+ exit = true;
+ break;
+ }
-
- count2 = length2 - gallopLeft(array[cursor1], tmp, 0, length2, length2 - 1, compare);
-
- if (count2 !== 0) {
- dest -= count2;
- cursor2 -= count2;
- length2 -= count2;
- customDest = dest + 1;
- customCursor = cursor2 + 1;
-
- for (i = 0; i < count2; i++) {
- array[customDest + i] = tmp[customCursor + i];
- }
-
- if (length2 <= 1) {
- exit = true;
- break;
- }
- }
-
- array[dest--] = array[cursor1--];
-
- if (--length1 === 0) {
++ }
++ } while ((count1 | count2) < _minGallop);
++ if (exit) {
++ break;
+ }
-
- if ((k *= 2) < 1) {
- return 0.5 * Math.pow(1024, k - 1);
++ do {
++ count1 = length1 - gallopRight(tmp[cursor2], array, start1, length1, length1 - 1, compare2);
++ if (count1 !== 0) {
++ dest -= count1;
++ cursor1 -= count1;
++ length1 -= count1;
++ customDest = dest + 1;
++ customCursor = cursor1 + 1;
++ for (i = count1 - 1; i >= 0; i--) {
++ array[customDest + i] = array[customCursor + i];
++ }
++ if (length1 === 0) {
+ exit = true;
+ break;
+ }
-
- _minGallop--;
- } while (count1 >= DEFAULT_MIN_GALLOPING || count2 >= DEFAULT_MIN_GALLOPING);
-
- if (exit) {
++ }
++ array[dest--] = tmp[cursor2--];
++ if (--length22 === 1) {
++ exit = true;
+ break;
+ }
-
- if (_minGallop < 0) {
- _minGallop = 0;
++ count2 = length22 - gallopLeft(array[cursor1], tmp, 0, length22, length22 - 1, compare2);
++ if (count2 !== 0) {
++ dest -= count2;
++ cursor2 -= count2;
++ length22 -= count2;
++ customDest = dest + 1;
++ customCursor = cursor2 + 1;
++ for (i = 0; i < count2; i++) {
++ array[customDest + i] = tmp[customCursor + i];
++ }
++ if (length22 <= 1) {
++ exit = true;
++ break;
++ }
+ }
-
- _minGallop += 2;
++ array[dest--] = array[cursor1--];
++ if (--length1 === 0) {
++ exit = true;
++ break;
++ }
++ _minGallop--;
++ } while (count1 >= DEFAULT_MIN_GALLOPING || count2 >= DEFAULT_MIN_GALLOPING);
++ if (exit) {
++ break;
}
-
- minGallop = _minGallop;
--
- if (minGallop < 1) {
- minGallop = 1;
- return 0.5 * (-Math.pow(2, -10 * (k - 1)) + 2);
- },
- circularIn: function (k) {
- return 1 - Math.sqrt(1 - k * k);
- },
- circularOut: function (k) {
- return Math.sqrt(1 - --k * k);
- },
- circularInOut: function (k) {
- if ((k *= 2) < 1) {
- return -0.5 * (Math.sqrt(1 - k * k) - 1);
++ if (_minGallop < 0) {
++ _minGallop = 0;
}
-
- if (length2 === 1) {
- dest -= length1;
- cursor1 -= length1;
- customDest = dest + 1;
- customCursor = cursor1 + 1;
--
- for (i = length1 - 1; i >= 0; i--) {
- array[customDest + i] = array[customCursor + i];
- }
- return 0.5 * (Math.sqrt(1 - (k -= 2) * k) + 1);
- },
- elasticIn: function (k) {
- var s;
- var a = 0.1;
- var p = 0.4;
--
- array[dest] = tmp[cursor2];
- } else if (length2 === 0) {
- throw new Error();
- if (k === 0) {
- return 0;
++ _minGallop += 2;
++ }
++ minGallop = _minGallop;
++ if (minGallop < 1) {
++ minGallop = 1;
++ }
++ if (length22 === 1) {
++ dest -= length1;
++ cursor1 -= length1;
++ customDest = dest + 1;
++ customCursor = cursor1 + 1;
++ for (i = length1 - 1; i >= 0; i--) {
++ array[customDest + i] = array[customCursor + i];
+ }
-
- if (k === 1) {
- return 1;
++ array[dest] = tmp[cursor2];
++ } else if (length22 === 0) {
++ throw new Error();
++ } else {
++ customCursor = dest - (length22 - 1);
++ for (i = 0; i < length22; i++) {
++ array[customCursor + i] = tmp[i];
+ }
-
- if (!a || a < 1) {
- a = 1;
- s = p / 4;
++ }
++ }
++ return {
++ mergeRuns,
++ forceMergeRuns,
++ pushRun
++ };
++}
++function sort(array, compare2, lo, hi) {
++ if (!lo) {
++ lo = 0;
++ }
++ if (!hi) {
++ hi = array.length;
++ }
++ var remaining = hi - lo;
++ if (remaining < 2) {
++ return;
++ }
++ var runLength = 0;
++ if (remaining < DEFAULT_MIN_MERGE) {
++ runLength = makeAscendingRun(array, lo, hi, compare2);
++ binaryInsertionSort(array, lo, hi, lo + runLength, compare2);
++ return;
++ }
++ var ts = TimSort(array, compare2);
++ var minRun = minRunLength(remaining);
++ do {
++ runLength = makeAscendingRun(array, lo, hi, compare2);
++ if (runLength < minRun) {
++ var force = remaining;
++ if (force > minRun) {
++ force = minRun;
++ }
++ binaryInsertionSort(array, lo, lo + force, lo + runLength, compare2);
++ runLength = force;
++ }
++ ts.pushRun(lo, runLength);
++ ts.mergeRuns();
++ remaining -= runLength;
++ lo += runLength;
++ } while (remaining !== 0);
++ ts.forceMergeRuns();
++}
++
++// node_modules/zrender/src/Storage.ts
++let invalidZErrorLogged = false;
++function logInvalidZError() {
++ if (invalidZErrorLogged) {
++ return;
++ }
++ invalidZErrorLogged = true;
++ console.warn("z / z2 / zlevel of displayable is invalid, which may cause unexpected errors");
++}
++function shapeCompareFunc(a, b) {
++ if (a.zlevel === b.zlevel) {
++ if (a.z === b.z) {
++ return a.z2 - b.z2;
++ }
++ return a.z - b.z;
++ }
++ return a.zlevel - b.zlevel;
++}
++class Storage3 {
++ constructor() {
++ this._roots = [];
++ this._displayList = [];
++ this._displayListLen = 0;
++ this.displayableSortFunc = shapeCompareFunc;
++ }
++ traverse(cb, context) {
++ for (let i = 0; i < this._roots.length; i++) {
++ this._roots[i].traverse(cb, context);
++ }
++ }
++ getDisplayList(update, includeIgnore) {
++ includeIgnore = includeIgnore || false;
++ const displayList = this._displayList;
++ if (update || !displayList.length) {
++ this.updateDisplayList(includeIgnore);
++ }
++ return displayList;
++ }
++ updateDisplayList(includeIgnore) {
++ this._displayListLen = 0;
++ const roots2 = this._roots;
++ const displayList = this._displayList;
++ for (let i = 0, len2 = roots2.length; i < len2; i++) {
++ this._updateAndAddDisplayable(roots2[i], null, includeIgnore);
++ }
++ displayList.length = this._displayListLen;
++ env_default.canvasSupported && sort(displayList, shapeCompareFunc);
++ }
++ _updateAndAddDisplayable(el, clipPaths, includeIgnore) {
++ if (el.ignore && !includeIgnore) {
++ return;
++ }
++ el.beforeUpdate();
++ el.update();
++ el.afterUpdate();
++ const userSetClipPath = el.getClipPath();
++ if (el.ignoreClip) {
++ clipPaths = null;
++ } else if (userSetClipPath) {
++ if (clipPaths) {
++ clipPaths = clipPaths.slice();
} else {
- customCursor = dest - (length2 - 1);
-
- for (i = 0; i < length2; i++) {
- array[customCursor + i] = tmp[i];
- s = p * Math.asin(1 / a) / (2 * Math.PI);
++ clipPaths = [];
+ }
-
- return -(a * Math.pow(2, 10 * (k -= 1)) * Math.sin((k - s) * (2 * Math.PI) / p));
- },
- elasticOut: function (k) {
- var s;
- var a = 0.1;
- var p = 0.4;
-
- if (k === 0) {
- return 0;
++ let currentClipPath = userSetClipPath;
++ let parentClipPath = el;
++ while (currentClipPath) {
++ currentClipPath.parent = parentClipPath;
++ currentClipPath.updateTransform();
++ clipPaths.push(currentClipPath);
++ parentClipPath = currentClipPath;
++ currentClipPath = currentClipPath.getClipPath();
+ }
-
- if (k === 1) {
- return 1;
- }
-
- if (!a || a < 1) {
- a = 1;
- s = p / 4;
- } else {
- s = p * Math.asin(1 / a) / (2 * Math.PI);
++ }
++ if (el.childrenRef) {
++ const children = el.childrenRef();
++ for (let i = 0; i < children.length; i++) {
++ const child = children[i];
++ if (el.__dirty) {
++ child.__dirty |= Element_default.REDARAW_BIT;
+ }
++ this._updateAndAddDisplayable(child, clipPaths, includeIgnore);
+ }
-
- return a * Math.pow(2, -10 * k) * Math.sin((k - s) * (2 * Math.PI) / p) + 1;
- },
- elasticInOut: function (k) {
- var s;
- var a = 0.1;
- var p = 0.4;
-
- if (k === 0) {
- return 0;
++ el.__dirty = 0;
++ } else {
++ const disp = el;
++ if (clipPaths && clipPaths.length) {
++ disp.__clipPaths = clipPaths;
++ } else if (disp.__clipPaths && disp.__clipPaths.length > 0) {
++ disp.__clipPaths = [];
+ }
-
- if (k === 1) {
- return 1;
++ if (isNaN(disp.z)) {
++ logInvalidZError();
++ disp.z = 0;
}
-
- if (!a || a < 1) {
- a = 1;
- s = p / 4;
- } else {
- s = p * Math.asin(1 / a) / (2 * Math.PI);
++ if (isNaN(disp.z2)) {
++ logInvalidZError();
++ disp.z2 = 0;
+ }
-
- if ((k *= 2) < 1) {
- return -0.5 * (a * Math.pow(2, 10 * (k -= 1)) * Math.sin((k - s) * (2 * Math.PI) / p));
++ if (isNaN(disp.zlevel)) {
++ logInvalidZError();
++ disp.zlevel = 0;
+ }
-
- return a * Math.pow(2, -10 * (k -= 1)) * Math.sin((k - s) * (2 * Math.PI) / p) * 0.5 + 1;
- },
- backIn: function (k) {
- var s = 1.70158;
- return k * k * ((s + 1) * k - s);
- },
- backOut: function (k) {
- var s = 1.70158;
- return --k * k * ((s + 1) * k + s) + 1;
- },
- backInOut: function (k) {
- var s = 1.70158 * 1.525;
-
- if ((k *= 2) < 1) {
- return 0.5 * (k * k * ((s + 1) * k - s));
++ this._displayList[this._displayListLen++] = disp;
+ }
-
- return {
- mergeRuns: mergeRuns,
- forceMergeRuns: forceMergeRuns,
- pushRun: pushRun
++ const decalEl = el.getDecalElement && el.getDecalElement();
++ if (decalEl) {
++ this._updateAndAddDisplayable(decalEl, clipPaths, includeIgnore);
++ }
++ const textGuide = el.getTextGuideLine();
++ if (textGuide) {
++ this._updateAndAddDisplayable(textGuide, clipPaths, includeIgnore);
++ }
++ const textEl = el.getTextContent();
++ if (textEl) {
++ this._updateAndAddDisplayable(textEl, clipPaths, includeIgnore);
++ }
++ }
++ addRoot(el) {
++ if (el.__zr && el.__zr.storage === this) {
++ return;
++ }
++ this._roots.push(el);
++ }
++ delRoot(el) {
++ if (el instanceof Array) {
++ for (let i = 0, l = el.length; i < l; i++) {
++ this.delRoot(el[i]);
+ }
-
- return 0.5 * ((k -= 2) * k * ((s + 1) * k + s) + 2);
- },
- bounceIn: function (k) {
- return 1 - easing.bounceOut(1 - k);
- },
- bounceOut: function (k) {
- if (k < 1 / 2.75) {
- return 7.5625 * k * k;
- } else if (k < 2 / 2.75) {
- return 7.5625 * (k -= 1.5 / 2.75) * k + 0.75;
- } else if (k < 2.5 / 2.75) {
- return 7.5625 * (k -= 2.25 / 2.75) * k + 0.9375;
++ return;
++ }
++ const idx = indexOf(this._roots, el);
++ if (idx >= 0) {
++ this._roots.splice(idx, 1);
++ }
++ }
++ delAllRoots() {
++ this._roots = [];
++ this._displayList = [];
++ this._displayListLen = 0;
++ return;
++ }
++ getRoots() {
++ return this._roots;
++ }
++ dispose() {
++ this._displayList = null;
++ this._roots = null;
++ }
++}
++
++// node_modules/zrender/src/animation/requestAnimationFrame.ts
++let requestAnimationFrame2;
++requestAnimationFrame2 = typeof window !== "undefined" && (window.requestAnimationFrame && window.requestAnimationFrame.bind(window) || window.msRequestAnimationFrame && window.msRequestAnimationFrame.bind(window) || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame) || function(func) {
++ return setTimeout(func, 16);
++};
++const requestAnimationFrame_default = requestAnimationFrame2;
++
++// node_modules/zrender/src/animation/Animation.ts
++class Animation extends Eventful2 {
++ constructor(opts) {
++ super();
++ this._running = false;
++ this._time = 0;
++ this._pausedTime = 0;
++ this._pauseStart = 0;
++ this._paused = false;
++ opts = opts || {};
++ this.stage = opts.stage || {};
++ this.onframe = opts.onframe || function() {
+ };
+ }
-
- function sort(array, compare, lo, hi) {
- if (!lo) {
- lo = 0;
++ addClip(clip2) {
++ if (clip2.animation) {
++ this.removeClip(clip2);
+ }
-
- if (!hi) {
- hi = array.length;
++ if (!this._clipsHead) {
++ this._clipsHead = this._clipsTail = clip2;
++ } else {
++ this._clipsTail.next = clip2;
++ clip2.prev = this._clipsTail;
++ clip2.next = null;
++ this._clipsTail = clip2;
+ }
-
- var remaining = hi - lo;
-
- if (remaining < 2) {
- return;
++ clip2.animation = this;
++ }
++ addAnimator(animator) {
++ animator.animation = this;
++ const clip2 = animator.getClip();
++ if (clip2) {
++ this.addClip(clip2);
+ }
-
- var runLength = 0;
-
- if (remaining < DEFAULT_MIN_MERGE) {
- runLength = makeAscendingRun(array, lo, hi, compare);
- binaryInsertionSort(array, lo, hi, lo + runLength, compare);
++ }
++ removeClip(clip2) {
++ if (!clip2.animation) {
+ return;
+ }
-
- var ts = TimSort(array, compare);
- var minRun = minRunLength(remaining);
-
- do {
- runLength = makeAscendingRun(array, lo, hi, compare);
-
- if (runLength < minRun) {
- var force = remaining;
-
- if (force > minRun) {
- force = minRun;
- }
-
- binaryInsertionSort(array, lo, lo + force, lo + runLength, compare);
- runLength = force;
++ const prev = clip2.prev;
++ const next = clip2.next;
++ if (prev) {
++ prev.next = next;
++ } else {
++ this._clipsHead = next;
++ }
++ if (next) {
++ next.prev = prev;
++ } else {
++ this._clipsTail = prev;
++ }
++ clip2.next = clip2.prev = clip2.animation = null;
++ }
++ removeAnimator(animator) {
++ const clip2 = animator.getClip();
++ if (clip2) {
++ this.removeClip(clip2);
++ }
++ animator.animation = null;
++ }
++ update(notTriggerStageUpdate) {
++ const time4 = new Date().getTime() - this._pausedTime;
++ const delta = time4 - this._time;
++ let clip2 = this._clipsHead;
++ while (clip2) {
++ const nextClip = clip2.next;
++ let finished = clip2.step(time4, delta);
++ if (finished) {
++ clip2.ondestroy && clip2.ondestroy();
++ this.removeClip(clip2);
++ clip2 = nextClip;
+ } else {
- return 7.5625 * (k -= 2.625 / 2.75) * k + 0.984375;
- }
- },
- bounceInOut: function (k) {
- if (k < 0.5) {
- return easing.bounceIn(k * 2) * 0.5;
++ clip2 = nextClip;
}
-
- ts.pushRun(lo, runLength);
- ts.mergeRuns();
- remaining -= runLength;
- lo += runLength;
- } while (remaining !== 0);
--
- ts.forceMergeRuns();
- return easing.bounceOut(k * 2 - 1) * 0.5 + 0.5;
+ }
- };
-
- var Clip = function () {
- function Clip(opts) {
- this._initialized = false;
- this._startTime = 0;
- this._pausedTime = 0;
- this._paused = false;
- this._life = opts.life || 1000;
- this._delay = opts.delay || 0;
- this.loop = opts.loop == null ? false : opts.loop;
- this.gap = opts.gap || 0;
- this.easing = opts.easing || 'linear';
- this.onframe = opts.onframe;
- this.ondestroy = opts.ondestroy;
- this.onrestart = opts.onrestart;
++ this._time = time4;
++ this.onframe(delta);
++ this.trigger("frame", delta);
++ if (this.stage.update && !notTriggerStageUpdate) {
++ this.stage.update();
+ }
-
- Clip.prototype.step = function (globalTime, deltaTime) {
- if (!this._initialized) {
- this._startTime = globalTime + this._delay;
- this._initialized = true;
- }
-
- if (this._paused) {
- this._pausedTime += deltaTime;
- return;
- }
-
- var percent = (globalTime - this._startTime - this._pausedTime) / this._life;
-
- if (percent < 0) {
- percent = 0;
- }
-
- percent = Math.min(percent, 1);
- var easing$1 = this.easing;
- var easingFunc = typeof easing$1 === 'string' ? easing[easing$1] : easing$1;
- var schedule = typeof easingFunc === 'function' ? easingFunc(percent) : percent;
- this.onframe && this.onframe(schedule);
-
- if (percent === 1) {
- if (this.loop) {
- this._restart(globalTime);
-
- this.onrestart && this.onrestart();
- } else {
- return true;
- }
+ }
-
- var invalidZErrorLogged = false;
-
- function logInvalidZError() {
- if (invalidZErrorLogged) {
++ _startLoop() {
++ const self2 = this;
++ this._running = true;
++ function step2() {
++ if (self2._running) {
++ requestAnimationFrame_default(step2);
++ !self2._paused && self2.update();
+ }
-
- return false;
- };
-
- Clip.prototype._restart = function (globalTime) {
- var remainder = (globalTime - this._startTime - this._pausedTime) % this._life;
- this._startTime = globalTime - remainder + this.gap;
- this._pausedTime = 0;
- };
-
- Clip.prototype.pause = function () {
++ }
++ requestAnimationFrame_default(step2);
++ }
++ start() {
++ if (this._running) {
+ return;
+ }
-
- invalidZErrorLogged = true;
- console.warn('z / z2 / zlevel of displayable is invalid, which may cause unexpected errors');
++ this._time = new Date().getTime();
++ this._pausedTime = 0;
++ this._startLoop();
+ }
-
- function shapeCompareFunc(a, b) {
- if (a.zlevel === b.zlevel) {
- if (a.z === b.z) {
- return a.z2 - b.z2;
- }
-
- return a.z - b.z;
++ stop() {
++ this._running = false;
++ }
++ pause() {
++ if (!this._paused) {
++ this._pauseStart = new Date().getTime();
+ this._paused = true;
- };
-
- Clip.prototype.resume = function () {
+ }
-
- return a.zlevel - b.zlevel;
+ }
-
- var Storage = function () {
- function Storage() {
- this._roots = [];
- this._displayList = [];
- this._displayListLen = 0;
- this.displayableSortFunc = shapeCompareFunc;
++ resume() {
++ if (this._paused) {
++ this._pausedTime += new Date().getTime() - this._pauseStart;
+ this._paused = false;
- };
-
- return Clip;
- }();
-
- var Entry = function () {
- function Entry(val) {
- this.value = val;
}
-
- Storage.prototype.traverse = function (cb, context) {
- for (var i = 0; i < this._roots.length; i++) {
- this._roots[i].traverse(cb, context);
- }
- };
-
- Storage.prototype.getDisplayList = function (update, includeIgnore) {
- includeIgnore = includeIgnore || false;
- var displayList = this._displayList;
-
- if (update || !displayList.length) {
- this.updateDisplayList(includeIgnore);
- }
-
- return displayList;
- };
-
- Storage.prototype.updateDisplayList = function (includeIgnore) {
- this._displayListLen = 0;
- var roots = this._roots;
- var displayList = this._displayList;
-
- for (var i = 0, len = roots.length; i < len; i++) {
- this._updateAndAddDisplayable(roots[i], null, includeIgnore);
- }
-
- displayList.length = this._displayListLen;
- env.canvasSupported && sort(displayList, shapeCompareFunc);
- };
-
- Storage.prototype._updateAndAddDisplayable = function (el, clipPaths, includeIgnore) {
- if (el.ignore && !includeIgnore) {
- return;
- }
-
- el.beforeUpdate();
- el.update();
- el.afterUpdate();
- var userSetClipPath = el.getClipPath();
-
- if (el.ignoreClip) {
- clipPaths = null;
- } else if (userSetClipPath) {
- if (clipPaths) {
- clipPaths = clipPaths.slice();
- } else {
- clipPaths = [];
- }
-
- var currentClipPath = userSetClipPath;
- var parentClipPath = el;
-
- while (currentClipPath) {
- currentClipPath.parent = parentClipPath;
- currentClipPath.updateTransform();
- clipPaths.push(currentClipPath);
- parentClipPath = currentClipPath;
- currentClipPath = currentClipPath.getClipPath();
- }
- }
-
- if (el.childrenRef) {
- var children = el.childrenRef();
-
- for (var i = 0; i < children.length; i++) {
- var child = children[i];
--
- if (el.__dirty) {
- child.markRedraw();
- }
- return Entry;
- }();
--
- this._updateAndAddDisplayable(child, clipPaths, includeIgnore);
- var LinkedList = function () {
- function LinkedList() {
- this._len = 0;
++ }
++ clear() {
++ let clip2 = this._clipsHead;
++ while (clip2) {
++ let nextClip = clip2.next;
++ clip2.prev = clip2.next = clip2.animation = null;
++ clip2 = nextClip;
+ }
-
- LinkedList.prototype.insert = function (val) {
- var entry = new Entry(val);
- this.insertEntry(entry);
- return entry;
- };
-
- LinkedList.prototype.insertEntry = function (entry) {
- if (!this.head) {
- this.head = this.tail = entry;
- } else {
- this.tail.next = entry;
- entry.prev = this.tail;
- entry.next = null;
- this.tail = entry;
- }
-
- this._len++;
- };
-
- LinkedList.prototype.remove = function (entry) {
- var prev = entry.prev;
- var next = entry.next;
-
- if (prev) {
- prev.next = next;
- } else {
- this.head = next;
- }
-
- if (next) {
- next.prev = prev;
++ this._clipsHead = this._clipsTail = null;
++ }
++ isFinished() {
++ return this._clipsHead == null;
++ }
++ animate(target, options) {
++ options = options || {};
++ this.start();
++ const animator = new Animator2(target, options.loop);
++ this.addAnimator(animator);
++ return animator;
++ }
++}
++
++// node_modules/zrender/src/dom/HandlerProxy.ts
++const TOUCH_CLICK_DELAY = 300;
++const globalEventSupported = env_default.domSupported;
++const localNativeListenerNames = function() {
++ const mouseHandlerNames = [
++ "click",
++ "dblclick",
++ "mousewheel",
++ "wheel",
++ "mouseout",
++ "mouseup",
++ "mousedown",
++ "mousemove",
++ "contextmenu"
++ ];
++ const touchHandlerNames = [
++ "touchstart",
++ "touchend",
++ "touchmove"
++ ];
++ const pointerEventNameMap = {
++ pointerdown: 1,
++ pointerup: 1,
++ pointermove: 1,
++ pointerout: 1
++ };
++ const pointerHandlerNames = map(mouseHandlerNames, function(name2) {
++ const nm = name2.replace("mouse", "pointer");
++ return pointerEventNameMap.hasOwnProperty(nm) ? nm : name2;
++ });
++ return {
++ mouse: mouseHandlerNames,
++ touch: touchHandlerNames,
++ pointer: pointerHandlerNames
++ };
++}();
++const globalNativeListenerNames = {
++ mouse: ["mousemove", "mouseup"],
++ pointer: ["pointermove", "pointerup"]
++};
++let wheelEventSupported = false;
++function isPointerFromTouch(event6) {
++ const pointerType = event6.pointerType;
++ return pointerType === "pen" || pointerType === "touch";
++}
++function setTouchTimer(scope) {
++ scope.touching = true;
++ if (scope.touchTimer != null) {
++ clearTimeout(scope.touchTimer);
++ scope.touchTimer = null;
++ }
++ scope.touchTimer = setTimeout(function() {
++ scope.touching = false;
++ scope.touchTimer = null;
++ }, 700);
++}
++function markTouch(event6) {
++ event6 && (event6.zrByTouch = true);
++}
++function normalizeGlobalEvent(instance, event6) {
++ return normalizeEvent(instance.dom, new FakeGlobalEvent(instance, event6), true);
++}
++function isLocalEl(instance, el) {
++ let elTmp = el;
++ let isLocal = false;
++ while (elTmp && elTmp.nodeType !== 9 && !(isLocal = elTmp.domBelongToZr || elTmp !== el && elTmp === instance.painterRoot)) {
++ elTmp = elTmp.parentNode;
++ }
++ return isLocal;
++}
++class FakeGlobalEvent {
++ constructor(instance, event6) {
++ this.stopPropagation = noop;
++ this.stopImmediatePropagation = noop;
++ this.preventDefault = noop;
++ this.type = event6.type;
++ this.target = this.currentTarget = instance.dom;
++ this.pointerType = event6.pointerType;
++ this.clientX = event6.clientX;
++ this.clientY = event6.clientY;
++ }
++}
++const localDOMHandlers = {
++ mousedown(event6) {
++ event6 = normalizeEvent(this.dom, event6);
++ this.__mayPointerCapture = [event6.zrX, event6.zrY];
++ this.trigger("mousedown", event6);
++ },
++ mousemove(event6) {
++ event6 = normalizeEvent(this.dom, event6);
++ const downPoint = this.__mayPointerCapture;
++ if (downPoint && (event6.zrX !== downPoint[0] || event6.zrY !== downPoint[1])) {
++ this.__togglePointerCapture(true);
++ }
++ this.trigger("mousemove", event6);
++ },
++ mouseup(event6) {
++ event6 = normalizeEvent(this.dom, event6);
++ this.__togglePointerCapture(false);
++ this.trigger("mouseup", event6);
++ },
++ mouseout(event6) {
++ if (event6.target !== this.dom) {
++ return;
++ }
++ event6 = normalizeEvent(this.dom, event6);
++ if (this.__pointerCapturing) {
++ event6.zrEventControl = "no_globalout";
++ }
++ const element = event6.toElement || event6.relatedTarget;
++ event6.zrIsToLocalDOM = isLocalEl(this, element);
++ this.trigger("mouseout", event6);
++ },
++ wheel(event6) {
++ wheelEventSupported = true;
++ event6 = normalizeEvent(this.dom, event6);
++ this.trigger("mousewheel", event6);
++ },
++ mousewheel(event6) {
++ if (wheelEventSupported) {
++ return;
++ }
++ event6 = normalizeEvent(this.dom, event6);
++ this.trigger("mousewheel", event6);
++ },
++ touchstart(event6) {
++ event6 = normalizeEvent(this.dom, event6);
++ markTouch(event6);
++ this.__lastTouchMoment = new Date();
++ this.handler.processGesture(event6, "start");
++ localDOMHandlers.mousemove.call(this, event6);
++ localDOMHandlers.mousedown.call(this, event6);
++ },
++ touchmove(event6) {
++ event6 = normalizeEvent(this.dom, event6);
++ markTouch(event6);
++ this.handler.processGesture(event6, "change");
++ localDOMHandlers.mousemove.call(this, event6);
++ },
++ touchend(event6) {
++ event6 = normalizeEvent(this.dom, event6);
++ markTouch(event6);
++ this.handler.processGesture(event6, "end");
++ localDOMHandlers.mouseup.call(this, event6);
++ if (+new Date() - +this.__lastTouchMoment < TOUCH_CLICK_DELAY) {
++ localDOMHandlers.click.call(this, event6);
++ }
++ },
++ pointerdown(event6) {
++ localDOMHandlers.mousedown.call(this, event6);
++ },
++ pointermove(event6) {
++ if (!isPointerFromTouch(event6)) {
++ localDOMHandlers.mousemove.call(this, event6);
++ }
++ },
++ pointerup(event6) {
++ localDOMHandlers.mouseup.call(this, event6);
++ },
++ pointerout(event6) {
++ if (!isPointerFromTouch(event6)) {
++ localDOMHandlers.mouseout.call(this, event6);
++ }
++ }
++};
++each(["click", "dblclick", "contextmenu"], function(name2) {
++ localDOMHandlers[name2] = function(event6) {
++ event6 = normalizeEvent(this.dom, event6);
++ this.trigger(name2, event6);
++ };
++});
++const globalDOMHandlers = {
++ pointermove: function(event6) {
++ if (!isPointerFromTouch(event6)) {
++ globalDOMHandlers.mousemove.call(this, event6);
++ }
++ },
++ pointerup: function(event6) {
++ globalDOMHandlers.mouseup.call(this, event6);
++ },
++ mousemove: function(event6) {
++ this.trigger("mousemove", event6);
++ },
++ mouseup: function(event6) {
++ const pointerCaptureReleasing = this.__pointerCapturing;
++ this.__togglePointerCapture(false);
++ this.trigger("mouseup", event6);
++ if (pointerCaptureReleasing) {
++ event6.zrEventControl = "only_globalout";
++ this.trigger("mouseout", event6);
++ }
++ }
++};
++function mountLocalDOMEventListeners(instance, scope) {
++ const domHandlers = scope.domHandlers;
++ if (env_default.pointerEventsSupported) {
++ each(localNativeListenerNames.pointer, function(nativeEventName) {
++ mountSingleDOMEventListener(scope, nativeEventName, function(event6) {
++ domHandlers[nativeEventName].call(instance, event6);
++ });
++ });
++ } else {
++ if (env_default.touchEventsSupported) {
++ each(localNativeListenerNames.touch, function(nativeEventName) {
++ mountSingleDOMEventListener(scope, nativeEventName, function(event6) {
++ domHandlers[nativeEventName].call(instance, event6);
++ setTouchTimer(scope);
++ });
++ });
++ }
++ each(localNativeListenerNames.mouse, function(nativeEventName) {
++ mountSingleDOMEventListener(scope, nativeEventName, function(event6) {
++ event6 = getNativeEvent(event6);
++ if (!scope.touching) {
++ domHandlers[nativeEventName].call(instance, event6);
+ }
-
- el.__dirty = 0;
++ });
++ });
++ }
++}
++function mountGlobalDOMEventListeners(instance, scope) {
++ if (env_default.pointerEventsSupported) {
++ each(globalNativeListenerNames.pointer, mount);
++ } else if (!env_default.touchEventsSupported) {
++ each(globalNativeListenerNames.mouse, mount);
++ }
++ function mount(nativeEventName) {
++ function nativeEventListener(event6) {
++ event6 = getNativeEvent(event6);
++ if (!isLocalEl(instance, event6.target)) {
++ event6 = normalizeGlobalEvent(instance, event6);
++ scope.domHandlers[nativeEventName].call(instance, event6);
++ }
++ }
++ mountSingleDOMEventListener(scope, nativeEventName, nativeEventListener, {capture: true});
++ }
++}
++function mountSingleDOMEventListener(scope, nativeEventName, listener, opt) {
++ scope.mounted[nativeEventName] = listener;
++ scope.listenerOpts[nativeEventName] = opt;
++ addEventListener(scope.domTarget, nativeEventName, listener, opt);
++}
++function unmountDOMEventListeners(scope) {
++ const mounted = scope.mounted;
++ for (let nativeEventName in mounted) {
++ if (mounted.hasOwnProperty(nativeEventName)) {
++ removeEventListener(scope.domTarget, nativeEventName, mounted[nativeEventName], scope.listenerOpts[nativeEventName]);
++ }
++ }
++ scope.mounted = {};
++}
++class DOMHandlerScope {
++ constructor(domTarget, domHandlers) {
++ this.mounted = {};
++ this.listenerOpts = {};
++ this.touching = false;
++ this.domTarget = domTarget;
++ this.domHandlers = domHandlers;
++ }
++}
++class HandlerDomProxy2 extends Eventful2 {
++ constructor(dom3, painterRoot) {
++ super();
++ this.__pointerCapturing = false;
++ this.dom = dom3;
++ this.painterRoot = painterRoot;
++ this._localHandlerScope = new DOMHandlerScope(dom3, localDOMHandlers);
++ if (globalEventSupported) {
++ this._globalHandlerScope = new DOMHandlerScope(document, globalDOMHandlers);
++ }
++ mountLocalDOMEventListeners(this, this._localHandlerScope);
++ }
++ dispose() {
++ unmountDOMEventListeners(this._localHandlerScope);
++ if (globalEventSupported) {
++ unmountDOMEventListeners(this._globalHandlerScope);
++ }
++ }
++ setCursor(cursorStyle) {
++ this.dom.style && (this.dom.style.cursor = cursorStyle || "default");
++ }
++ __togglePointerCapture(isPointerCapturing) {
++ this.__mayPointerCapture = null;
++ if (globalEventSupported && +this.__pointerCapturing ^ +isPointerCapturing) {
++ this.__pointerCapturing = isPointerCapturing;
++ const globalHandlerScope = this._globalHandlerScope;
++ isPointerCapturing ? mountGlobalDOMEventListeners(this, globalHandlerScope) : unmountDOMEventListeners(globalHandlerScope);
++ }
++ }
++}
++
++// node_modules/zrender/src/graphic/Displayable.ts
++const STYLE_MAGIC_KEY = "__zr_style_" + Math.round(Math.random() * 10);
++const DEFAULT_COMMON_STYLE = {
++ shadowBlur: 0,
++ shadowOffsetX: 0,
++ shadowOffsetY: 0,
++ shadowColor: "#000",
++ opacity: 1,
++ blend: "source-over"
++};
++const DEFAULT_COMMON_ANIMATION_PROPS = {
++ style: {
++ shadowBlur: true,
++ shadowOffsetX: true,
++ shadowOffsetY: true,
++ shadowColor: true,
++ opacity: true
++ }
++};
++DEFAULT_COMMON_STYLE[STYLE_MAGIC_KEY] = true;
++const PRIMARY_STATES_KEYS2 = ["z", "z2", "invisible"];
++class Displayable13 extends Element_default {
++ constructor(props) {
++ super(props);
++ }
++ _init(props) {
++ const keysArr = keys(props);
++ for (let i = 0; i < keysArr.length; i++) {
++ const key = keysArr[i];
++ if (key === "style") {
++ this.useStyle(props[key]);
} else {
- var disp = el;
-
- if (clipPaths && clipPaths.length) {
- disp.__clipPaths = clipPaths;
- } else if (disp.__clipPaths && disp.__clipPaths.length > 0) {
- disp.__clipPaths = [];
- }
-
- if (isNaN(disp.z)) {
- logInvalidZError();
- disp.z = 0;
- }
-
- if (isNaN(disp.z2)) {
- logInvalidZError();
- disp.z2 = 0;
- }
-
- if (isNaN(disp.zlevel)) {
- logInvalidZError();
- disp.zlevel = 0;
- }
-
- this._displayList[this._displayListLen++] = disp;
- }
-
- var textGuide = el.getTextGuideLine();
-
- if (textGuide) {
- this._updateAndAddDisplayable(textGuide, clipPaths, includeIgnore);
- }
-
- var textEl = el.getTextContent();
-
- if (textEl) {
- this._updateAndAddDisplayable(textEl, clipPaths, includeIgnore);
- this.tail = prev;
++ super.attrKV(key, props[key]);
}
-
- entry.next = entry.prev = null;
- this._len--;
-- };
--
- Storage.prototype.addRoot = function (el) {
- if (el.__zr && el.__zr.storage === this) {
- return;
- }
- LinkedList.prototype.len = function () {
- return this._len;
- };
--
- this._roots.push(el);
- LinkedList.prototype.clear = function () {
- this.head = this.tail = null;
- this._len = 0;
-- };
--
- Storage.prototype.delRoot = function (el) {
- if (el instanceof Array) {
- for (var i = 0, l = el.length; i < l; i++) {
- this.delRoot(el[i]);
- return LinkedList;
- }();
-
- var LRU = function () {
- function LRU(maxSize) {
- this._list = new LinkedList();
- this._maxSize = 10;
- this._map = {};
- this._maxSize = maxSize;
+ }
-
- LRU.prototype.put = function (key, value) {
- var list = this._list;
- var map = this._map;
- var removed = null;
-
- if (map[key] == null) {
- var len = list.len();
- var entry = this._lastRemovedEntry;
-
- if (len >= this._maxSize && len > 0) {
- var leastUsedEntry = list.head;
- list.remove(leastUsedEntry);
- delete map[leastUsedEntry.key];
- removed = leastUsedEntry.value;
- this._lastRemovedEntry = leastUsedEntry;
- }
-
- if (entry) {
- entry.value = value;
- } else {
- entry = new Entry(value);
++ if (!this.style) {
++ this.useStyle({});
++ }
++ }
++ beforeBrush() {
++ }
++ afterBrush() {
++ }
++ innerBeforeBrush() {
++ }
++ innerAfterBrush() {
++ }
++ shouldBePainted(viewWidth, viewHeight, considerClipPath, considerAncestors) {
++ const m2 = this.transform;
++ if (this.ignore || this.invisible || this.style.opacity === 0 || this.culling && isDisplayableCulled(this, viewWidth, viewHeight) || m2 && !m2[0] && !m2[3]) {
++ return false;
++ }
++ if (considerClipPath && this.__clipPaths) {
++ for (let i = 0; i < this.__clipPaths.length; ++i) {
++ if (this.__clipPaths[i].isZeroArea()) {
++ return false;
}
-
- return;
- }
-
- var idx = indexOf(this._roots, el);
-
- if (idx >= 0) {
- this._roots.splice(idx, 1);
- }
- };
-
- Storage.prototype.delAllRoots = function () {
- this._roots = [];
- this._displayList = [];
- this._displayListLen = 0;
- return;
- };
-
- Storage.prototype.getRoots = function () {
- return this._roots;
- };
-
- Storage.prototype.dispose = function () {
- this._displayList = null;
- this._roots = null;
- };
-
- return Storage;
- }();
-
- var requestAnimationFrame;
-
- requestAnimationFrame = typeof window !== 'undefined' && (window.requestAnimationFrame && window.requestAnimationFrame.bind(window) || window.msRequestAnimationFrame && window.msRequestAnimationFrame.bind(window) || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame) || function (func) {
- return setTimeout(func, 16);
- };
-
- var requestAnimationFrame$1 = requestAnimationFrame;
- var easing = {
- linear: function (k) {
- return k;
- },
- quadraticIn: function (k) {
- return k * k;
- },
- quadraticOut: function (k) {
- return k * (2 - k);
- },
- quadraticInOut: function (k) {
- if ((k *= 2) < 1) {
- return 0.5 * k * k;
- }
-
- return -0.5 * (--k * (k - 2) - 1);
- },
- cubicIn: function (k) {
- return k * k * k;
- },
- cubicOut: function (k) {
- return --k * k * k + 1;
- },
- cubicInOut: function (k) {
- if ((k *= 2) < 1) {
- return 0.5 * k * k * k;
- }
-
- return 0.5 * ((k -= 2) * k * k + 2);
- },
- quarticIn: function (k) {
- return k * k * k * k;
- },
- quarticOut: function (k) {
- return 1 - --k * k * k * k;
- },
- quarticInOut: function (k) {
- if ((k *= 2) < 1) {
- return 0.5 * k * k * k * k;
- }
-
- return -0.5 * ((k -= 2) * k * k * k - 2);
- },
- quinticIn: function (k) {
- return k * k * k * k * k;
- },
- quinticOut: function (k) {
- return --k * k * k * k * k + 1;
- },
- quinticInOut: function (k) {
- if ((k *= 2) < 1) {
- return 0.5 * k * k * k * k * k;
- }
-
- return 0.5 * ((k -= 2) * k * k * k * k + 2);
- },
- sinusoidalIn: function (k) {
- return 1 - Math.cos(k * Math.PI / 2);
- },
- sinusoidalOut: function (k) {
- return Math.sin(k * Math.PI / 2);
- },
- sinusoidalInOut: function (k) {
- return 0.5 * (1 - Math.cos(Math.PI * k));
- },
- exponentialIn: function (k) {
- return k === 0 ? 0 : Math.pow(1024, k - 1);
- },
- exponentialOut: function (k) {
- return k === 1 ? 1 : 1 - Math.pow(2, -10 * k);
- },
- exponentialInOut: function (k) {
- if (k === 0) {
- return 0;
- }
--
- if (k === 1) {
- return 1;
- entry.key = key;
- list.insertEntry(entry);
- map[key] = entry;
}
--
- if ((k *= 2) < 1) {
- return 0.5 * Math.pow(1024, k - 1);
- return removed;
- };
-
- LRU.prototype.get = function (key) {
- var entry = this._map[key];
- var list = this._list;
-
- if (entry != null) {
- if (entry !== list.tail) {
- list.remove(entry);
- list.insertEntry(entry);
++ }
++ if (considerAncestors && this.parent) {
++ let parent = this.parent;
++ while (parent) {
++ if (parent.ignore) {
++ return false;
+ }
-
- return entry.value;
++ parent = parent.parent;
}
- };
--
- return 0.5 * (-Math.pow(2, -10 * (k - 1)) + 2);
- },
- circularIn: function (k) {
- return 1 - Math.sqrt(1 - k * k);
- },
- circularOut: function (k) {
- return Math.sqrt(1 - --k * k);
- },
- circularInOut: function (k) {
- if ((k *= 2) < 1) {
- return -0.5 * (Math.sqrt(1 - k * k) - 1);
- LRU.prototype.clear = function () {
- this._list.clear();
-
- this._map = {};
- };
-
- LRU.prototype.len = function () {
- return this._list.len();
- };
-
- return LRU;
- }();
-
- var kCSSColorTable = {
- '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 clampCssByte(i) {
- i = Math.round(i);
- return i < 0 ? 0 : i > 255 ? 255 : i;
- }
-
- function clampCssAngle(i) {
- i = Math.round(i);
- return i < 0 ? 0 : i > 360 ? 360 : i;
- }
-
- function clampCssFloat(f) {
- return f < 0 ? 0 : f > 1 ? 1 : f;
++ }
++ return true;
+ }
-
- function parseCssInt(val) {
- var str = val;
-
- if (str.length && str.charAt(str.length - 1) === '%') {
- return clampCssByte(parseFloat(str) / 100 * 255);
++ contain(x, y) {
++ return this.rectContain(x, y);
++ }
++ traverse(cb, context) {
++ cb.call(context, this);
++ }
++ rectContain(x, y) {
++ const coord = this.transformCoordToLocal(x, y);
++ const rect = this.getBoundingRect();
++ return rect.contain(coord[0], coord[1]);
++ }
++ getPaintRect() {
++ let rect = this._paintRect;
++ if (!this._paintRect || this.__dirty) {
++ const transform8 = this.transform;
++ const elRect = this.getBoundingRect();
++ const style2 = this.style;
++ const shadowSize = style2.shadowBlur || 0;
++ const shadowOffsetX = style2.shadowOffsetX || 0;
++ const shadowOffsetY = style2.shadowOffsetY || 0;
++ rect = this._paintRect || (this._paintRect = new BoundingRect_default(0, 0, 0, 0));
++ if (transform8) {
++ BoundingRect_default.applyTransform(rect, elRect, transform8);
++ } else {
++ rect.copy(elRect);
+ }
-
- return 0.5 * (Math.sqrt(1 - (k -= 2) * k) + 1);
- },
- elasticIn: function (k) {
- var s;
- var a = 0.1;
- var p = 0.4;
-
- if (k === 0) {
- return 0;
++ if (shadowSize || shadowOffsetX || shadowOffsetY) {
++ rect.width += shadowSize * 2 + Math.abs(shadowOffsetX);
++ rect.height += shadowSize * 2 + Math.abs(shadowOffsetY);
++ rect.x = Math.min(rect.x, rect.x + shadowOffsetX - shadowSize);
++ rect.y = Math.min(rect.y, rect.y + shadowOffsetY - shadowSize);
+ }
-
- if (k === 1) {
- return 1;
++ const tolerance = this.dirtyRectTolerance;
++ if (!rect.isZero()) {
++ rect.x = Math.floor(rect.x - tolerance);
++ rect.y = Math.floor(rect.y - tolerance);
++ rect.width = Math.ceil(rect.width + 1 + tolerance * 2);
++ rect.height = Math.ceil(rect.height + 1 + tolerance * 2);
+ }
-
- if (!a || a < 1) {
- a = 1;
- s = p / 4;
+ }
-
- return clampCssByte(parseInt(str, 10));
++ return rect;
+ }
-
- function parseCssFloat(val) {
- var str = val;
-
- if (str.length && str.charAt(str.length - 1) === '%') {
- return clampCssFloat(parseFloat(str) / 100);
++ setPrevPaintRect(paintRect) {
++ if (paintRect) {
++ this._prevPaintRect = this._prevPaintRect || new BoundingRect_default(0, 0, 0, 0);
++ this._prevPaintRect.copy(paintRect);
++ } else {
++ this._prevPaintRect = null;
+ }
-
- return clampCssFloat(parseFloat(str));
+ }
-
- function cssHueToRgb(m1, m2, h) {
- if (h < 0) {
- h += 1;
- } else if (h > 1) {
- h -= 1;
++ getPrevPaintRect() {
++ return this._prevPaintRect;
++ }
++ animateStyle(loop) {
++ return this.animate("style", loop);
++ }
++ updateDuringAnimation(targetKey) {
++ if (targetKey === "style") {
++ this.dirtyStyle();
++ } else {
++ this.markRedraw();
+ }
-
- if (h * 6 < 1) {
- return m1 + (m2 - m1) * h * 6;
++ }
++ attrKV(key, value) {
++ if (key !== "style") {
++ super.attrKV(key, value);
++ } else {
++ if (!this.style) {
++ this.useStyle(value);
+ } else {
- s = p * Math.asin(1 / a) / (2 * Math.PI);
- }
-
- return -(a * Math.pow(2, 10 * (k -= 1)) * Math.sin((k - s) * (2 * Math.PI) / p));
- },
- elasticOut: function (k) {
- var s;
- var a = 0.1;
- var p = 0.4;
-
- if (k === 0) {
- return 0;
- }
-
- if (k === 1) {
- return 1;
++ this.setStyle(value);
+ }
-
- if (!a || a < 1) {
- a = 1;
- s = p / 4;
+ }
-
- if (h * 2 < 1) {
- return m2;
++ }
++ setStyle(keyOrObj, value) {
++ if (typeof keyOrObj === "string") {
++ this.style[keyOrObj] = value;
++ } else {
++ extend(this.style, keyOrObj);
+ }
-
- if (h * 3 < 2) {
- return m1 + (m2 - m1) * (2 / 3 - h) * 6;
++ this.dirtyStyle();
++ return this;
++ }
++ dirtyStyle() {
++ this.markRedraw();
++ this.__dirty |= Displayable13.STYLE_CHANGED_BIT;
++ if (this._rect) {
++ this._rect = null;
+ }
-
- return m1;
+ }
-
- function lerpNumber(a, b, p) {
- return a + (b - a) * p;
++ dirty() {
++ this.dirtyStyle();
+ }
-
- function setRgba(out, r, g, b, a) {
- out[0] = r;
- out[1] = g;
- out[2] = b;
- out[3] = a;
- return out;
++ styleChanged() {
++ return !!(this.__dirty & Displayable13.STYLE_CHANGED_BIT);
+ }
-
- function copyRgba(out, a) {
- out[0] = a[0];
- out[1] = a[1];
- out[2] = a[2];
- out[3] = a[3];
- return out;
++ styleUpdated() {
++ this.__dirty &= ~Displayable13.STYLE_CHANGED_BIT;
+ }
-
- var colorCache = new LRU(20);
- var lastRemovedArr = null;
-
- function putToCache(colorStr, rgbaArr) {
- if (lastRemovedArr) {
- copyRgba(lastRemovedArr, rgbaArr);
- }
-
- lastRemovedArr = colorCache.put(colorStr, lastRemovedArr || rgbaArr.slice());
++ createStyle(obj) {
++ return createObject(DEFAULT_COMMON_STYLE, obj);
+ }
-
- function parse(colorStr, rgbaArr) {
- if (!colorStr) {
- return;
++ useStyle(obj) {
++ if (!obj[STYLE_MAGIC_KEY]) {
++ obj = this.createStyle(obj);
+ }
-
- rgbaArr = rgbaArr || [];
- var cached = colorCache.get(colorStr);
-
- if (cached) {
- return copyRgba(rgbaArr, cached);
++ if (this.__inHover) {
++ this.__hoverStyle = obj;
++ } else {
++ this.style = obj;
+ }
-
- colorStr = colorStr + '';
- var str = colorStr.replace(/ /g, '').toLowerCase();
-
- if (str in kCSSColorTable) {
- copyRgba(rgbaArr, kCSSColorTable[str]);
- putToCache(colorStr, rgbaArr);
- return rgbaArr;
++ this.dirtyStyle();
++ }
++ isStyleObject(obj) {
++ return obj[STYLE_MAGIC_KEY];
++ }
++ _innerSaveToNormal(toState) {
++ super._innerSaveToNormal(toState);
++ const normalState = this._normalState;
++ if (toState.style && !normalState.style) {
++ normalState.style = this._mergeStyle(this.createStyle(), this.style);
+ }
-
- var strLen = str.length;
-
- if (str.charAt(0) === '#') {
- if (strLen === 4 || strLen === 5) {
- var iv = parseInt(str.slice(1, 4), 16);
-
- if (!(iv >= 0 && iv <= 0xfff)) {
- setRgba(rgbaArr, 0, 0, 0, 1);
- return;
++ this._savePrimaryToNormal(toState, normalState, PRIMARY_STATES_KEYS2);
++ }
++ _applyStateObj(stateName, state, normalState, keepCurrentStates, transition, animationCfg) {
++ super._applyStateObj(stateName, state, normalState, keepCurrentStates, transition, animationCfg);
++ const needsRestoreToNormal = !(state && keepCurrentStates);
++ let targetStyle;
++ if (state && state.style) {
++ if (transition) {
++ if (keepCurrentStates) {
++ targetStyle = state.style;
++ } else {
++ targetStyle = this._mergeStyle(this.createStyle(), normalState.style);
++ this._mergeStyle(targetStyle, state.style);
+ }
-
- setRgba(rgbaArr, (iv & 0xf00) >> 4 | (iv & 0xf00) >> 8, iv & 0xf0 | (iv & 0xf0) >> 4, iv & 0xf | (iv & 0xf) << 4, strLen === 5 ? parseInt(str.slice(4), 16) / 0xf : 1);
- putToCache(colorStr, rgbaArr);
- return rgbaArr;
- } else if (strLen === 7 || strLen === 9) {
- var iv = parseInt(str.slice(1, 7), 16);
-
- if (!(iv >= 0 && iv <= 0xffffff)) {
- setRgba(rgbaArr, 0, 0, 0, 1);
- return;
++ } else {
++ targetStyle = this._mergeStyle(this.createStyle(), keepCurrentStates ? this.style : normalState.style);
++ this._mergeStyle(targetStyle, state.style);
++ }
++ } else if (needsRestoreToNormal) {
++ targetStyle = normalState.style;
++ }
++ if (targetStyle) {
++ if (transition) {
++ const sourceStyle = this.style;
++ this.style = this.createStyle(needsRestoreToNormal ? {} : sourceStyle);
++ if (needsRestoreToNormal) {
++ const changedKeys = keys(sourceStyle);
++ for (let i = 0; i < changedKeys.length; i++) {
++ const key = changedKeys[i];
++ if (key in targetStyle) {
++ targetStyle[key] = targetStyle[key];
++ this.style[key] = sourceStyle[key];
++ }
++ }
+ }
-
- setRgba(rgbaArr, (iv & 0xff0000) >> 16, (iv & 0xff00) >> 8, iv & 0xff, strLen === 9 ? parseInt(str.slice(7), 16) / 0xff : 1);
- putToCache(colorStr, rgbaArr);
- return rgbaArr;
++ const targetKeys = keys(targetStyle);
++ for (let i = 0; i < targetKeys.length; i++) {
++ const key = targetKeys[i];
++ this.style[key] = this.style[key];
++ }
++ this._transitionState(stateName, {
++ style: targetStyle
++ }, animationCfg, this.getAnimationStyleProps());
+ } else {
- s = p * Math.asin(1 / a) / (2 * Math.PI);
++ this.useStyle(targetStyle);
}
-
- return a * Math.pow(2, -10 * k) * Math.sin((k - s) * (2 * Math.PI) / p) + 1;
- },
- elasticInOut: function (k) {
- var s;
- var a = 0.1;
- var p = 0.4;
--
- if (k === 0) {
- return 0;
- return;
+ }
-
- var op = str.indexOf('(');
- var ep = str.indexOf(')');
-
- if (op !== -1 && ep + 1 === strLen) {
- var fname = str.substr(0, op);
- var params = str.substr(op + 1, ep - (op + 1)).split(',');
- var alpha = 1;
-
- switch (fname) {
- case 'rgba':
- if (params.length !== 4) {
- return params.length === 3 ? setRgba(rgbaArr, +params[0], +params[1], +params[2], 1) : setRgba(rgbaArr, 0, 0, 0, 1);
- }
-
- alpha = parseCssFloat(params.pop());
-
- case 'rgb':
- if (params.length !== 3) {
- setRgba(rgbaArr, 0, 0, 0, 1);
- return;
- }
-
- setRgba(rgbaArr, parseCssInt(params[0]), parseCssInt(params[1]), parseCssInt(params[2]), alpha);
- putToCache(colorStr, rgbaArr);
- return rgbaArr;
-
- case 'hsla':
- if (params.length !== 4) {
- setRgba(rgbaArr, 0, 0, 0, 1);
- return;
- }
-
- params[3] = parseCssFloat(params[3]);
- hsla2rgba(params, rgbaArr);
- putToCache(colorStr, rgbaArr);
- return rgbaArr;
-
- case 'hsl':
- if (params.length !== 3) {
- setRgba(rgbaArr, 0, 0, 0, 1);
- return;
- }
-
- hsla2rgba(params, rgbaArr);
- putToCache(colorStr, rgbaArr);
- return rgbaArr;
-
- default:
- return;
++ for (let i = 0; i < PRIMARY_STATES_KEYS2.length; i++) {
++ let key = PRIMARY_STATES_KEYS2[i];
++ if (state && state[key] != null) {
++ this[key] = state[key];
++ } else if (needsRestoreToNormal) {
++ if (normalState[key] != null) {
++ this[key] = normalState[key];
++ }
++ }
++ }
++ }
++ _mergeStates(states36) {
++ const mergedState = super._mergeStates(states36);
++ let mergedStyle;
++ for (let i = 0; i < states36.length; i++) {
++ const state = states36[i];
++ if (state.style) {
++ mergedStyle = mergedStyle || {};
++ this._mergeStyle(mergedStyle, state.style);
++ }
++ }
++ if (mergedStyle) {
++ mergedState.style = mergedStyle;
++ }
++ return mergedState;
++ }
++ _mergeStyle(targetStyle, sourceStyle) {
++ extend(targetStyle, sourceStyle);
++ return targetStyle;
++ }
++ getAnimationStyleProps() {
++ return DEFAULT_COMMON_ANIMATION_PROPS;
++ }
++}
++Displayable13.STYLE_CHANGED_BIT = 2;
++Displayable13.initDefaultProps = function() {
++ const dispProto = Displayable13.prototype;
++ dispProto.type = "displayable";
++ dispProto.invisible = false;
++ dispProto.z = 0;
++ dispProto.z2 = 0;
++ dispProto.zlevel = 0;
++ dispProto.culling = false;
++ dispProto.cursor = "pointer";
++ dispProto.rectHover = false;
++ dispProto.incremental = false;
++ dispProto._rect = null;
++ dispProto.dirtyRectTolerance = 0;
++ dispProto.__dirty = Element_default.REDARAW_BIT | Displayable13.STYLE_CHANGED_BIT;
++}();
++const tmpRect = new BoundingRect_default(0, 0, 0, 0);
++const viewRect = new BoundingRect_default(0, 0, 0, 0);
++function isDisplayableCulled(el, width, height) {
++ tmpRect.copy(el.getBoundingRect());
++ if (el.transform) {
++ tmpRect.applyTransform(el.transform);
++ }
++ viewRect.width = width;
++ viewRect.height = height;
++ return !tmpRect.intersect(viewRect);
++}
++const Displayable_default = Displayable13;
++
++// node_modules/zrender/src/core/curve.ts
++const mathPow = Math.pow;
++const mathSqrt2 = Math.sqrt;
++const EPSILON4 = 1e-8;
++const EPSILON_NUMERIC = 1e-4;
++const THREE_SQRT = mathSqrt2(3);
++const ONE_THIRD = 1 / 3;
++const _v0 = create2();
++const _v1 = create2();
++const _v2 = create2();
++function isAroundZero(val) {
++ return val > -EPSILON4 && val < EPSILON4;
++}
++function isNotAroundZero2(val) {
++ return val > EPSILON4 || val < -EPSILON4;
++}
++function cubicAt(p0, p1, p2, p3, t) {
++ const onet = 1 - t;
++ return onet * onet * (onet * p0 + 3 * t * p1) + t * t * (t * p3 + 3 * onet * p2);
++}
++function cubicDerivativeAt(p0, p1, p2, p3, t) {
++ const onet = 1 - t;
++ return 3 * (((p1 - p0) * onet + 2 * (p2 - p1) * t) * onet + (p3 - p2) * t * t);
++}
++function cubicRootAt(p0, p1, p2, p3, val, roots2) {
++ const a = p3 + 3 * (p1 - p2) - p0;
++ const b = 3 * (p2 - p1 * 2 + p0);
++ const c = 3 * (p1 - p0);
++ const d = p0 - val;
++ const A = b * b - 3 * a * c;
++ const B = b * c - 9 * a * d;
++ const C = c * c - 3 * b * d;
++ let n = 0;
++ if (isAroundZero(A) && isAroundZero(B)) {
++ if (isAroundZero(b)) {
++ roots2[0] = 0;
++ } else {
++ const t1 = -c / b;
++ if (t1 >= 0 && t1 <= 1) {
++ roots2[n++] = t1;
}
-
- if (k === 1) {
- return 1;
+ }
-
- setRgba(rgbaArr, 0, 0, 0, 1);
- return;
- }
-
- function hsla2rgba(hsla, rgba) {
- var h = (parseFloat(hsla[0]) % 360 + 360) % 360 / 360;
- var s = parseCssFloat(hsla[1]);
- var l = parseCssFloat(hsla[2]);
- var m2 = l <= 0.5 ? l * (s + 1) : l + s - l * s;
- var m1 = l * 2 - m2;
- rgba = rgba || [];
- setRgba(rgba, clampCssByte(cssHueToRgb(m1, m2, h + 1 / 3) * 255), clampCssByte(cssHueToRgb(m1, m2, h) * 255), clampCssByte(cssHueToRgb(m1, m2, h - 1 / 3) * 255), 1);
-
- if (hsla.length === 4) {
- rgba[3] = hsla[3];
- }
-
- return rgba;
- }
-
- function rgba2hsla(rgba) {
- if (!rgba) {
- return;
- }
-
- var R = rgba[0] / 255;
- var G = rgba[1] / 255;
- var B = rgba[2] / 255;
- var vMin = Math.min(R, G, B);
- var vMax = Math.max(R, G, B);
- var delta = vMax - vMin;
- var L = (vMax + vMin) / 2;
- var H;
- var S;
-
- if (delta === 0) {
- H = 0;
- S = 0;
- } else {
- if (L < 0.5) {
- S = delta / (vMax + vMin);
++ } else {
++ const disc = B * B - 4 * A * C;
++ if (isAroundZero(disc)) {
++ const K = B / A;
++ const t1 = -b / a + K;
++ const t2 = -K / 2;
++ if (t1 >= 0 && t1 <= 1) {
++ roots2[n++] = t1;
++ }
++ if (t2 >= 0 && t2 <= 1) {
++ roots2[n++] = t2;
++ }
++ } else if (disc > 0) {
++ const discSqrt = mathSqrt2(disc);
++ let Y1 = A * b + 1.5 * a * (-B + discSqrt);
++ let Y2 = A * b + 1.5 * a * (-B - discSqrt);
++ if (Y1 < 0) {
++ Y1 = -mathPow(-Y1, ONE_THIRD);
+ } else {
- S = delta / (2 - vMax - vMin);
++ Y1 = mathPow(Y1, ONE_THIRD);
}
--
- if (!a || a < 1) {
- a = 1;
- s = p / 4;
- var deltaR = ((vMax - R) / 6 + delta / 2) / delta;
- var deltaG = ((vMax - G) / 6 + delta / 2) / delta;
- var deltaB = ((vMax - B) / 6 + delta / 2) / delta;
-
- if (R === vMax) {
- H = deltaB - deltaG;
- } else if (G === vMax) {
- H = 1 / 3 + deltaR - deltaB;
- } else if (B === vMax) {
- H = 2 / 3 + deltaG - deltaR;
++ if (Y2 < 0) {
++ Y2 = -mathPow(-Y2, ONE_THIRD);
+ } else {
- s = p * Math.asin(1 / a) / (2 * Math.PI);
++ Y2 = mathPow(Y2, ONE_THIRD);
}
--
- if ((k *= 2) < 1) {
- return -0.5 * (a * Math.pow(2, 10 * (k -= 1)) * Math.sin((k - s) * (2 * Math.PI) / p));
- if (H < 0) {
- H += 1;
++ const t1 = (-b - (Y1 + Y2)) / (3 * a);
++ if (t1 >= 0 && t1 <= 1) {
++ roots2[n++] = t1;
}
-
- return a * Math.pow(2, -10 * (k -= 1)) * Math.sin((k - s) * (2 * Math.PI) / p) * 0.5 + 1;
- },
- backIn: function (k) {
- var s = 1.70158;
- return k * k * ((s + 1) * k - s);
- },
- backOut: function (k) {
- var s = 1.70158;
- return --k * k * ((s + 1) * k + s) + 1;
- },
- backInOut: function (k) {
- var s = 1.70158 * 1.525;
--
- if ((k *= 2) < 1) {
- return 0.5 * (k * k * ((s + 1) * k - s));
- if (H > 1) {
... 206706 lines suppressed ...
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org